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 /drivers/mtd | |
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 'drivers/mtd')
-rw-r--r-- | drivers/mtd/mtdsuper.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/mtd/mtdsuper.c b/drivers/mtd/mtdsuper.c index 9b430f20b640..e376f4517905 100644 --- a/drivers/mtd/mtdsuper.c +++ b/drivers/mtd/mtdsuper.c | |||
@@ -184,25 +184,25 @@ int get_sb_mtd(struct file_system_type *fs_type, int flags, | |||
184 | ret = path_lookup(dev_name, LOOKUP_FOLLOW, &nd); | 184 | ret = path_lookup(dev_name, LOOKUP_FOLLOW, &nd); |
185 | 185 | ||
186 | DEBUG(1, "MTDSB: path_lookup() returned %d, inode %p\n", | 186 | DEBUG(1, "MTDSB: path_lookup() returned %d, inode %p\n", |
187 | ret, nd.dentry ? nd.dentry->d_inode : NULL); | 187 | ret, nd.path.dentry ? nd.path.dentry->d_inode : NULL); |
188 | 188 | ||
189 | if (ret) | 189 | if (ret) |
190 | return ret; | 190 | return ret; |
191 | 191 | ||
192 | ret = -EINVAL; | 192 | ret = -EINVAL; |
193 | 193 | ||
194 | if (!S_ISBLK(nd.dentry->d_inode->i_mode)) | 194 | if (!S_ISBLK(nd.path.dentry->d_inode->i_mode)) |
195 | goto out; | 195 | goto out; |
196 | 196 | ||
197 | if (nd.mnt->mnt_flags & MNT_NODEV) { | 197 | if (nd.path.mnt->mnt_flags & MNT_NODEV) { |
198 | ret = -EACCES; | 198 | ret = -EACCES; |
199 | goto out; | 199 | goto out; |
200 | } | 200 | } |
201 | 201 | ||
202 | if (imajor(nd.dentry->d_inode) != MTD_BLOCK_MAJOR) | 202 | if (imajor(nd.path.dentry->d_inode) != MTD_BLOCK_MAJOR) |
203 | goto not_an_MTD_device; | 203 | goto not_an_MTD_device; |
204 | 204 | ||
205 | mtdnr = iminor(nd.dentry->d_inode); | 205 | mtdnr = iminor(nd.path.dentry->d_inode); |
206 | path_release(&nd); | 206 | path_release(&nd); |
207 | 207 | ||
208 | return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super, | 208 | return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super, |