diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 18:22:41 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-23 18:22:41 -0400 |
commit | 9e12a7e7d89ad813d01092890010cf67d0f914bd (patch) | |
tree | 0f7510f8f3364833024cb92267b2d39183fe803d /fs/nfs/fscache.c | |
parent | a7ddbf891b8236b51fb3c9574555eb7d7d13aca6 (diff) | |
parent | 2df54806389205d76bc3d1ce8a10cc14889ddec9 (diff) |
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6:
NFS: Propagate 'fsc' mount option through automounts
sunrpc/rpc_pipe: fix kernel-doc notation
sunrpc: xdr_xcode_hyper helpers cannot presume 64-bit alignment
NFS: Add nfs_alloc_parsed_mount_data
NFS/RPC: fix problems with reestablish_timeout and related code.
NFS: Get rid of the NFS_MOUNT_VER3 and NFS_MOUNT_TCP flags
Diffstat (limited to 'fs/nfs/fscache.c')
-rw-r--r-- | fs/nfs/fscache.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/fs/nfs/fscache.c b/fs/nfs/fscache.c index 379be678cb7e..70fad69eb959 100644 --- a/fs/nfs/fscache.c +++ b/fs/nfs/fscache.c | |||
@@ -58,17 +58,34 @@ void nfs_fscache_release_client_cookie(struct nfs_client *clp) | |||
58 | /* | 58 | /* |
59 | * Get the cache cookie for an NFS superblock. We have to handle | 59 | * Get the cache cookie for an NFS superblock. We have to handle |
60 | * uniquification here because the cache doesn't do it for us. | 60 | * uniquification here because the cache doesn't do it for us. |
61 | * | ||
62 | * The default uniquifier is just an empty string, but it may be overridden | ||
63 | * either by the 'fsc=xxx' option to mount, or by inheriting it from the parent | ||
64 | * superblock across an automount point of some nature. | ||
61 | */ | 65 | */ |
62 | void nfs_fscache_get_super_cookie(struct super_block *sb, | 66 | void nfs_fscache_get_super_cookie(struct super_block *sb, const char *uniq, |
63 | struct nfs_parsed_mount_data *data) | 67 | struct nfs_clone_mount *mntdata) |
64 | { | 68 | { |
65 | struct nfs_fscache_key *key, *xkey; | 69 | struct nfs_fscache_key *key, *xkey; |
66 | struct nfs_server *nfss = NFS_SB(sb); | 70 | struct nfs_server *nfss = NFS_SB(sb); |
67 | struct rb_node **p, *parent; | 71 | struct rb_node **p, *parent; |
68 | const char *uniq = data->fscache_uniq ?: ""; | ||
69 | int diff, ulen; | 72 | int diff, ulen; |
70 | 73 | ||
71 | ulen = strlen(uniq); | 74 | if (uniq) { |
75 | ulen = strlen(uniq); | ||
76 | } else if (mntdata) { | ||
77 | struct nfs_server *mnt_s = NFS_SB(mntdata->sb); | ||
78 | if (mnt_s->fscache_key) { | ||
79 | uniq = mnt_s->fscache_key->key.uniquifier; | ||
80 | ulen = mnt_s->fscache_key->key.uniq_len; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | if (!uniq) { | ||
85 | uniq = ""; | ||
86 | ulen = 1; | ||
87 | } | ||
88 | |||
72 | key = kzalloc(sizeof(*key) + ulen, GFP_KERNEL); | 89 | key = kzalloc(sizeof(*key) + ulen, GFP_KERNEL); |
73 | if (!key) | 90 | if (!key) |
74 | return; | 91 | return; |