12 #include <linux/kernel.h>
13 #include <linux/module.h>
15 #include <linux/slab.h>
18 #include <linux/sched.h>
21 static const char *afs_voltypes[] = {
"R/W",
"R/O",
"BAK" };
59 if (IS_ERR(vlocation)) {
60 ret = PTR_ERR(vlocation);
67 if (params->
force && !(vlocation->
vldb.vidmask & (1 << params->
type)))
71 for (loop = 0; loop < vlocation->
vldb.nservers; loop++)
72 srvtmask |= vlocation->
vldb.srvtmask[loop];
75 if (!(srvtmask & (1 << params->
type)))
90 volume = vlocation->
vols[params->
type];
96 _debug(
"creating new volume record");
116 for (loop = 0; loop < 8; loop++) {
117 if (vlocation->
vldb.srvtmask[loop] & (1 << volume->
type)) {
119 volume->
cell, &vlocation->
vldb.servers[loop]);
120 if (IS_ERR(server)) {
121 ret = PTR_ERR(server);
131 #ifdef CONFIG_AFS_FSCACHE
132 volume->cache = fscache_acquire_cookie(vlocation->cache,
142 _debug(
"kAFS selected %s volume %08x",
143 afs_voltypes[volume->
type], volume->
vid);
162 for (loop = volume->
nservers - 1; loop >= 0; loop--)
201 #ifdef CONFIG_AFS_FSCACHE
202 fscache_relinquish_cookie(volume->cache, 0);
206 for (loop = volume->
nservers - 1; loop >= 0; loop--)
240 _leave(
" = %d [no servers]", ret);
247 for (loop = 0; loop < volume->
nservers; loop++) {
248 server = volume->
servers[loop];
251 _debug(
"consider %d [%d]", loop, state);
258 _leave(
" = %p (picked %08x)",
332 for (loop = 0; loop < volume->
nservers; loop++)
333 if (volume->
servers[loop] == server)
337 goto try_next_server_upw;
343 sizeof(volume->
servers[loop]) *
351 goto try_next_server_upw;
361 _leave(
" [completely rejected]");
378 printk(
"kAFS: SERVER DEAD state=%d\n", result);
381 goto try_next_server;
390 _leave(
" [local failure]");
399 _leave(
" [try next server]");