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/afs/mntpt.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/afs/mntpt.c')
-rw-r--r-- | fs/afs/mntpt.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index 5ce43b63c60e..4136dfb9ffb8 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c | |||
@@ -218,14 +218,14 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
218 | _enter("%p{%s},{%s:%p{%s},}", | 218 | _enter("%p{%s},{%s:%p{%s},}", |
219 | dentry, | 219 | dentry, |
220 | dentry->d_name.name, | 220 | dentry->d_name.name, |
221 | nd->mnt->mnt_devname, | 221 | nd->path.mnt->mnt_devname, |
222 | dentry, | 222 | dentry, |
223 | nd->dentry->d_name.name); | 223 | nd->path.dentry->d_name.name); |
224 | 224 | ||
225 | dput(nd->dentry); | 225 | dput(nd->path.dentry); |
226 | nd->dentry = dget(dentry); | 226 | nd->path.dentry = dget(dentry); |
227 | 227 | ||
228 | newmnt = afs_mntpt_do_automount(nd->dentry); | 228 | newmnt = afs_mntpt_do_automount(nd->path.dentry); |
229 | if (IS_ERR(newmnt)) { | 229 | if (IS_ERR(newmnt)) { |
230 | path_release(nd); | 230 | path_release(nd); |
231 | return (void *)newmnt; | 231 | return (void *)newmnt; |
@@ -235,17 +235,17 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
235 | err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts); | 235 | err = do_add_mount(newmnt, nd, MNT_SHRINKABLE, &afs_vfsmounts); |
236 | switch (err) { | 236 | switch (err) { |
237 | case 0: | 237 | case 0: |
238 | dput(nd->dentry); | 238 | dput(nd->path.dentry); |
239 | mntput(nd->mnt); | 239 | mntput(nd->path.mnt); |
240 | nd->mnt = newmnt; | 240 | nd->path.mnt = newmnt; |
241 | nd->dentry = dget(newmnt->mnt_root); | 241 | nd->path.dentry = dget(newmnt->mnt_root); |
242 | schedule_delayed_work(&afs_mntpt_expiry_timer, | 242 | schedule_delayed_work(&afs_mntpt_expiry_timer, |
243 | afs_mntpt_expiry_timeout * HZ); | 243 | afs_mntpt_expiry_timeout * HZ); |
244 | break; | 244 | break; |
245 | case -EBUSY: | 245 | case -EBUSY: |
246 | /* someone else made a mount here whilst we were busy */ | 246 | /* someone else made a mount here whilst we were busy */ |
247 | while (d_mountpoint(nd->dentry) && | 247 | while (d_mountpoint(nd->path.dentry) && |
248 | follow_down(&nd->mnt, &nd->dentry)) | 248 | follow_down(&nd->path.mnt, &nd->path.dentry)) |
249 | ; | 249 | ; |
250 | err = 0; | 250 | err = 0; |
251 | default: | 251 | default: |