aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms
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 /arch/powerpc/platforms
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 'arch/powerpc/platforms')
-rw-r--r--arch/powerpc/platforms/cell/spufs/inode.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c
index e6e6559c55ed..6d1228c66c5e 100644
--- a/arch/powerpc/platforms/cell/spufs/inode.c
+++ b/arch/powerpc/platforms/cell/spufs/inode.c
@@ -1,3 +1,4 @@
1
1/* 2/*
2 * SPU file system 3 * SPU file system
3 * 4 *
@@ -592,7 +593,7 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
592 593
593 ret = -EINVAL; 594 ret = -EINVAL;
594 /* check if we are on spufs */ 595 /* check if we are on spufs */
595 if (nd->dentry->d_sb->s_type != &spufs_type) 596 if (nd->path.dentry->d_sb->s_type != &spufs_type)
596 goto out; 597 goto out;
597 598
598 /* don't accept undefined flags */ 599 /* don't accept undefined flags */
@@ -600,9 +601,9 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
600 goto out; 601 goto out;
601 602
602 /* only threads can be underneath a gang */ 603 /* only threads can be underneath a gang */
603 if (nd->dentry != nd->dentry->d_sb->s_root) { 604 if (nd->path.dentry != nd->path.dentry->d_sb->s_root) {
604 if ((flags & SPU_CREATE_GANG) || 605 if ((flags & SPU_CREATE_GANG) ||
605 !SPUFS_I(nd->dentry->d_inode)->i_gang) 606 !SPUFS_I(nd->path.dentry->d_inode)->i_gang)
606 goto out; 607 goto out;
607 } 608 }
608 609
@@ -618,16 +619,17 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode,
618 mode &= ~current->fs->umask; 619 mode &= ~current->fs->umask;
619 620
620 if (flags & SPU_CREATE_GANG) 621 if (flags & SPU_CREATE_GANG)
621 return spufs_create_gang(nd->dentry->d_inode, 622 return spufs_create_gang(nd->path.dentry->d_inode,
622 dentry, nd->mnt, mode); 623 dentry, nd->path.mnt, mode);
623 else 624 else
624 return spufs_create_context(nd->dentry->d_inode, 625 return spufs_create_context(nd->path.dentry->d_inode,
625 dentry, nd->mnt, flags, mode, filp); 626 dentry, nd->path.mnt, flags, mode,
627 filp);
626 628
627out_dput: 629out_dput:
628 dput(dentry); 630 dput(dentry);
629out_dir: 631out_dir:
630 mutex_unlock(&nd->dentry->d_inode->i_mutex); 632 mutex_unlock(&nd->path.dentry->d_inode->i_mutex);
631out: 633out:
632 return ret; 634 return ret;
633} 635}