Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 165553
b: refs/heads/master
c: 2df5480
h: refs/heads/master
i:
  165551: 172ad6a
v: v3
  • Loading branch information
David Howells authored and Trond Myklebust committed Sep 23, 2009
1 parent 19df732 commit e1c4808
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4111d4fde6aa04a2e42c43d0e74593e6144b0f0f
refs/heads/master: 2df54806389205d76bc3d1ce8a10cc14889ddec9
1 change: 1 addition & 0 deletions trunk/fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,7 @@ static void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_serve
target->acdirmin = source->acdirmin;
target->acdirmax = source->acdirmax;
target->caps = source->caps;
target->options = source->options;
}

/*
Expand Down
25 changes: 21 additions & 4 deletions trunk/fs/nfs/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,34 @@ void nfs_fscache_release_client_cookie(struct nfs_client *clp)
/*
* Get the cache cookie for an NFS superblock. We have to handle
* uniquification here because the cache doesn't do it for us.
*
* The default uniquifier is just an empty string, but it may be overridden
* either by the 'fsc=xxx' option to mount, or by inheriting it from the parent
* superblock across an automount point of some nature.
*/
void nfs_fscache_get_super_cookie(struct super_block *sb,
struct nfs_parsed_mount_data *data)
void nfs_fscache_get_super_cookie(struct super_block *sb, const char *uniq,
struct nfs_clone_mount *mntdata)
{
struct nfs_fscache_key *key, *xkey;
struct nfs_server *nfss = NFS_SB(sb);
struct rb_node **p, *parent;
const char *uniq = data->fscache_uniq ?: "";
int diff, ulen;

ulen = strlen(uniq);
if (uniq) {
ulen = strlen(uniq);
} else if (mntdata) {
struct nfs_server *mnt_s = NFS_SB(mntdata->sb);
if (mnt_s->fscache_key) {
uniq = mnt_s->fscache_key->key.uniquifier;
ulen = mnt_s->fscache_key->key.uniq_len;
}
}

if (!uniq) {
uniq = "";
ulen = 1;
}

key = kzalloc(sizeof(*key) + ulen, GFP_KERNEL);
if (!key)
return;
Expand Down
6 changes: 4 additions & 2 deletions trunk/fs/nfs/fscache.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ extern void nfs_fscache_get_client_cookie(struct nfs_client *);
extern void nfs_fscache_release_client_cookie(struct nfs_client *);

extern void nfs_fscache_get_super_cookie(struct super_block *,
struct nfs_parsed_mount_data *);
const char *,
struct nfs_clone_mount *);
extern void nfs_fscache_release_super_cookie(struct super_block *);

extern void nfs_fscache_init_inode_cookie(struct inode *);
Expand Down Expand Up @@ -173,7 +174,8 @@ static inline void nfs_fscache_release_client_cookie(struct nfs_client *clp) {}

static inline void nfs_fscache_get_super_cookie(
struct super_block *sb,
struct nfs_parsed_mount_data *data)
const char *uniq,
struct nfs_clone_mount *mntdata)
{
}
static inline void nfs_fscache_release_super_cookie(struct super_block *sb) {}
Expand Down
9 changes: 7 additions & 2 deletions trunk/fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,8 @@ static int nfs_get_sb(struct file_system_type *fs_type,
if (!s->s_root) {
/* initial superblock/root creation */
nfs_fill_super(s, data);
nfs_fscache_get_super_cookie(s, data);
nfs_fscache_get_super_cookie(
s, data ? data->fscache_uniq : NULL, NULL);
}

mntroot = nfs_get_root(s, mntfh);
Expand Down Expand Up @@ -2255,6 +2256,7 @@ static int nfs_xdev_get_sb(struct file_system_type *fs_type, int flags,
if (!s->s_root) {
/* initial superblock/root creation */
nfs_clone_super(s, data->sb);
nfs_fscache_get_super_cookie(s, NULL, data);
}

mntroot = nfs_get_root(s, data->fh);
Expand Down Expand Up @@ -2507,7 +2509,8 @@ static int nfs4_remote_get_sb(struct file_system_type *fs_type,
if (!s->s_root) {
/* initial superblock/root creation */
nfs4_fill_super(s);
nfs_fscache_get_super_cookie(s, data);
nfs_fscache_get_super_cookie(
s, data ? data->fscache_uniq : NULL, NULL);
}

mntroot = nfs4_get_root(s, mntfh);
Expand Down Expand Up @@ -2740,6 +2743,7 @@ static int nfs4_xdev_get_sb(struct file_system_type *fs_type, int flags,
if (!s->s_root) {
/* initial superblock/root creation */
nfs4_clone_super(s, data->sb);
nfs_fscache_get_super_cookie(s, NULL, data);
}

mntroot = nfs4_get_root(s, data->fh);
Expand Down Expand Up @@ -2821,6 +2825,7 @@ static int nfs4_remote_referral_get_sb(struct file_system_type *fs_type,
if (!s->s_root) {
/* initial superblock/root creation */
nfs4_fill_super(s);
nfs_fscache_get_super_cookie(s, NULL, data);
}

mntroot = nfs4_get_root(s, &mntfh);
Expand Down

0 comments on commit e1c4808

Please sign in to comment.