aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJan Blunck <jblunck@suse.de>2008-02-14 22:34:32 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 00:13:33 -0500
commit4ac9137858e08a19f29feac4e1f4df7c268b0ba5 (patch)
treef5b5d84fd12fcc2b0ba0e7ce1a79ff381ad8f5dd /drivers
parentc5e725f33b733a77de622e91b6ba5645fcf070be (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')
-rw-r--r--drivers/md/dm-table.c2
-rw-r--r--drivers/mtd/mtdsuper.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index f16062982383..b611a3c61504 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -361,7 +361,7 @@ static int lookup_device(const char *path, dev_t *dev)
361 if ((r = path_lookup(path, LOOKUP_FOLLOW, &nd))) 361 if ((r = path_lookup(path, LOOKUP_FOLLOW, &nd)))
362 return r; 362 return r;
363 363
364 inode = nd.dentry->d_inode; 364 inode = nd.path.dentry->d_inode;
365 if (!inode) { 365 if (!inode) {
366 r = -ENOENT; 366 r = -ENOENT;
367 goto out; 367 goto out;
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,