diff options
author | Jan Blunck <jblunck@suse.de> | 2008-02-14 22:34:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-15 00:13:33 -0500 |
commit | 4ac9137858e08a19f29feac4e1f4df7c268b0ba5 (patch) | |
tree | f5b5d84fd12fcc2b0ba0e7ce1a79ff381ad8f5dd /fs/nfsd/nfs4recover.c | |
parent | c5e725f33b733a77de622e91b6ba5645fcf070be (diff) |
Embed a struct path into struct nameidata instead of nd->{dentry,mnt}
This is the central patch of a cleanup series. In most cases there is no good
reason why someone would want to use a dentry for itself. This series reflects
that fact and embeds a struct path into nameidata.
Together with the other patches of this series
- it enforced the correct order of getting/releasing the reference count on
<dentry,vfsmount> pairs
- it prepares the VFS for stacking support since it is essential to have a
struct path in every place where the stack can be traversed
- it reduces the overall code size:
without patch series:
text data bss dec hex filename
5321639 858418 715768 6895825 6938d1 vmlinux
with patch series:
text data bss dec hex filename
5320026 858418 715768 6894212 693284 vmlinux
This patch:
Switch from nd->{dentry,mnt} to nd->path.{dentry,mnt} everywhere.
[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: fix cifs]
[akpm@linux-foundation.org: fix smack]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Casey Schaufler <casey@schaufler-ca.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nfsd/nfs4recover.c')
-rw-r--r-- | fs/nfsd/nfs4recover.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 1602cd00dd45..a7a8fdf86ea7 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -120,9 +120,9 @@ out_no_tfm: | |||
120 | static void | 120 | static void |
121 | nfsd4_sync_rec_dir(void) | 121 | nfsd4_sync_rec_dir(void) |
122 | { | 122 | { |
123 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); | 123 | mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); |
124 | nfsd_sync_dir(rec_dir.dentry); | 124 | nfsd_sync_dir(rec_dir.path.dentry); |
125 | mutex_unlock(&rec_dir.dentry->d_inode->i_mutex); | 125 | mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); |
126 | } | 126 | } |
127 | 127 | ||
128 | int | 128 | int |
@@ -142,9 +142,9 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
142 | nfs4_save_user(&uid, &gid); | 142 | nfs4_save_user(&uid, &gid); |
143 | 143 | ||
144 | /* lock the parent */ | 144 | /* lock the parent */ |
145 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); | 145 | mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); |
146 | 146 | ||
147 | dentry = lookup_one_len(dname, rec_dir.dentry, HEXDIR_LEN-1); | 147 | dentry = lookup_one_len(dname, rec_dir.path.dentry, HEXDIR_LEN-1); |
148 | if (IS_ERR(dentry)) { | 148 | if (IS_ERR(dentry)) { |
149 | status = PTR_ERR(dentry); | 149 | status = PTR_ERR(dentry); |
150 | goto out_unlock; | 150 | goto out_unlock; |
@@ -154,11 +154,11 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
154 | dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n"); | 154 | dprintk("NFSD: nfsd4_create_clid_dir: DIRECTORY EXISTS\n"); |
155 | goto out_put; | 155 | goto out_put; |
156 | } | 156 | } |
157 | status = vfs_mkdir(rec_dir.dentry->d_inode, dentry, S_IRWXU); | 157 | status = vfs_mkdir(rec_dir.path.dentry->d_inode, dentry, S_IRWXU); |
158 | out_put: | 158 | out_put: |
159 | dput(dentry); | 159 | dput(dentry); |
160 | out_unlock: | 160 | out_unlock: |
161 | mutex_unlock(&rec_dir.dentry->d_inode->i_mutex); | 161 | mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); |
162 | if (status == 0) { | 162 | if (status == 0) { |
163 | clp->cl_firststate = 1; | 163 | clp->cl_firststate = 1; |
164 | nfsd4_sync_rec_dir(); | 164 | nfsd4_sync_rec_dir(); |
@@ -221,7 +221,7 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f) | |||
221 | 221 | ||
222 | nfs4_save_user(&uid, &gid); | 222 | nfs4_save_user(&uid, &gid); |
223 | 223 | ||
224 | filp = dentry_open(dget(dir), mntget(rec_dir.mnt), O_RDONLY); | 224 | filp = dentry_open(dget(dir), mntget(rec_dir.path.mnt), O_RDONLY); |
225 | status = PTR_ERR(filp); | 225 | status = PTR_ERR(filp); |
226 | if (IS_ERR(filp)) | 226 | if (IS_ERR(filp)) |
227 | goto out; | 227 | goto out; |
@@ -286,9 +286,9 @@ nfsd4_unlink_clid_dir(char *name, int namlen) | |||
286 | 286 | ||
287 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); | 287 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); |
288 | 288 | ||
289 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); | 289 | mutex_lock(&rec_dir.path.dentry->d_inode->i_mutex); |
290 | dentry = lookup_one_len(name, rec_dir.dentry, namlen); | 290 | dentry = lookup_one_len(name, rec_dir.path.dentry, namlen); |
291 | mutex_unlock(&rec_dir.dentry->d_inode->i_mutex); | 291 | mutex_unlock(&rec_dir.path.dentry->d_inode->i_mutex); |
292 | if (IS_ERR(dentry)) { | 292 | if (IS_ERR(dentry)) { |
293 | status = PTR_ERR(dentry); | 293 | status = PTR_ERR(dentry); |
294 | return status; | 294 | return status; |
@@ -297,7 +297,7 @@ nfsd4_unlink_clid_dir(char *name, int namlen) | |||
297 | if (!dentry->d_inode) | 297 | if (!dentry->d_inode) |
298 | goto out; | 298 | goto out; |
299 | 299 | ||
300 | status = nfsd4_clear_clid_dir(rec_dir.dentry, dentry); | 300 | status = nfsd4_clear_clid_dir(rec_dir.path.dentry, dentry); |
301 | out: | 301 | out: |
302 | dput(dentry); | 302 | dput(dentry); |
303 | return status; | 303 | return status; |
@@ -347,12 +347,12 @@ nfsd4_recdir_purge_old(void) { | |||
347 | 347 | ||
348 | if (!rec_dir_init) | 348 | if (!rec_dir_init) |
349 | return; | 349 | return; |
350 | status = nfsd4_list_rec_dir(rec_dir.dentry, purge_old); | 350 | status = nfsd4_list_rec_dir(rec_dir.path.dentry, purge_old); |
351 | if (status == 0) | 351 | if (status == 0) |
352 | nfsd4_sync_rec_dir(); | 352 | nfsd4_sync_rec_dir(); |
353 | if (status) | 353 | if (status) |
354 | printk("nfsd4: failed to purge old clients from recovery" | 354 | printk("nfsd4: failed to purge old clients from recovery" |
355 | " directory %s\n", rec_dir.dentry->d_name.name); | 355 | " directory %s\n", rec_dir.path.dentry->d_name.name); |
356 | return; | 356 | return; |
357 | } | 357 | } |
358 | 358 | ||
@@ -373,10 +373,10 @@ int | |||
373 | nfsd4_recdir_load(void) { | 373 | nfsd4_recdir_load(void) { |
374 | int status; | 374 | int status; |
375 | 375 | ||
376 | status = nfsd4_list_rec_dir(rec_dir.dentry, load_recdir); | 376 | status = nfsd4_list_rec_dir(rec_dir.path.dentry, load_recdir); |
377 | if (status) | 377 | if (status) |
378 | printk("nfsd4: failed loading clients from recovery" | 378 | printk("nfsd4: failed loading clients from recovery" |
379 | " directory %s\n", rec_dir.dentry->d_name.name); | 379 | " directory %s\n", rec_dir.path.dentry->d_name.name); |
380 | return status; | 380 | return status; |
381 | } | 381 | } |
382 | 382 | ||