diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 22:02:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-22 22:02:39 -0400 |
commit | bbd9d6f7fbb0305c9a592bf05a32e87eb364a4ff (patch) | |
tree | 12b2bb4202b05f6ae6a43c6ce830a0472043dbe5 /arch/powerpc/platforms | |
parent | 8e204874db000928e37199c2db82b7eb8966cc3c (diff) | |
parent | 5a9a43646cf709312d71eca71cef90ad802f28f9 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (107 commits)
vfs: use ERR_CAST for err-ptr tossing in lookup_instantiate_filp
isofs: Remove global fs lock
jffs2: fix IN_DELETE_SELF on overwriting rename() killing a directory
fix IN_DELETE_SELF on overwriting rename() on ramfs et.al.
mm/truncate.c: fix build for CONFIG_BLOCK not enabled
fs:update the NOTE of the file_operations structure
Remove dead code in dget_parent()
AFS: Fix silly characters in a comment
switch d_add_ci() to d_splice_alias() in "found negative" case as well
simplify gfs2_lookup()
jfs_lookup(): don't bother with . or ..
get rid of useless dget_parent() in btrfs rename() and link()
get rid of useless dget_parent() in fs/btrfs/ioctl.c
fs: push i_mutex and filemap_write_and_wait down into ->fsync() handlers
drivers: fix up various ->llseek() implementations
fs: handle SEEK_HOLE/SEEK_DATA properly in all fs's that define their own llseek
Ext4: handle SEEK_HOLE/SEEK_DATA generically
Btrfs: implement our own ->llseek
fs: add SEEK_HOLE and SEEK_DATA flags
reiserfs: make reiserfs default to barrier=flush
...
Fix up trivial conflicts in fs/xfs/linux-2.6/xfs_super.c due to the new
shrinker callout for the inode cache, that clashed with the xfs code to
start the periodic workers later.
Diffstat (limited to 'arch/powerpc/platforms')
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/file.c | 11 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/inode.c | 29 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/syscalls.c | 22 |
4 files changed, 30 insertions, 34 deletions
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index 3c7c3f82d842..fb59c46e9e9e 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -1850,9 +1850,16 @@ out: | |||
1850 | return ret; | 1850 | return ret; |
1851 | } | 1851 | } |
1852 | 1852 | ||
1853 | static int spufs_mfc_fsync(struct file *file, int datasync) | 1853 | static int spufs_mfc_fsync(struct file *file, loff_t start, loff_t end, int datasync) |
1854 | { | 1854 | { |
1855 | return spufs_mfc_flush(file, NULL); | 1855 | struct inode *inode = file->f_path.dentry->d_inode; |
1856 | int err = filemap_write_and_wait_range(inode->i_mapping, start, end); | ||
1857 | if (!err) { | ||
1858 | mutex_lock(&inode->i_mutex); | ||
1859 | err = spufs_mfc_flush(file, NULL); | ||
1860 | mutex_unlock(&inode->i_mutex); | ||
1861 | } | ||
1862 | return err; | ||
1856 | } | 1863 | } |
1857 | 1864 | ||
1858 | static int spufs_mfc_fasync(int fd, struct file *file, int on) | 1865 | static int spufs_mfc_fasync(int fd, struct file *file, int on) |
diff --git a/arch/powerpc/platforms/cell/spufs/inode.c b/arch/powerpc/platforms/cell/spufs/inode.c index 856e9c398068..e481f6b9a789 100644 --- a/arch/powerpc/platforms/cell/spufs/inode.c +++ b/arch/powerpc/platforms/cell/spufs/inode.c | |||
@@ -611,15 +611,14 @@ out: | |||
611 | 611 | ||
612 | static struct file_system_type spufs_type; | 612 | static struct file_system_type spufs_type; |
613 | 613 | ||
614 | long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode, | 614 | long spufs_create(struct path *path, struct dentry *dentry, |
615 | struct file *filp) | 615 | unsigned int flags, mode_t mode, struct file *filp) |
616 | { | 616 | { |
617 | struct dentry *dentry; | ||
618 | int ret; | 617 | int ret; |
619 | 618 | ||
620 | ret = -EINVAL; | 619 | ret = -EINVAL; |
621 | /* check if we are on spufs */ | 620 | /* check if we are on spufs */ |
622 | if (nd->path.dentry->d_sb->s_type != &spufs_type) | 621 | if (path->dentry->d_sb->s_type != &spufs_type) |
623 | goto out; | 622 | goto out; |
624 | 623 | ||
625 | /* don't accept undefined flags */ | 624 | /* don't accept undefined flags */ |
@@ -627,33 +626,27 @@ long spufs_create(struct nameidata *nd, unsigned int flags, mode_t mode, | |||
627 | goto out; | 626 | goto out; |
628 | 627 | ||
629 | /* only threads can be underneath a gang */ | 628 | /* only threads can be underneath a gang */ |
630 | if (nd->path.dentry != nd->path.dentry->d_sb->s_root) { | 629 | if (path->dentry != path->dentry->d_sb->s_root) { |
631 | if ((flags & SPU_CREATE_GANG) || | 630 | if ((flags & SPU_CREATE_GANG) || |
632 | !SPUFS_I(nd->path.dentry->d_inode)->i_gang) | 631 | !SPUFS_I(path->dentry->d_inode)->i_gang) |
633 | goto out; | 632 | goto out; |
634 | } | 633 | } |
635 | 634 | ||
636 | dentry = lookup_create(nd, 1); | ||
637 | ret = PTR_ERR(dentry); | ||
638 | if (IS_ERR(dentry)) | ||
639 | goto out_dir; | ||
640 | |||
641 | mode &= ~current_umask(); | 635 | mode &= ~current_umask(); |
642 | 636 | ||
643 | if (flags & SPU_CREATE_GANG) | 637 | if (flags & SPU_CREATE_GANG) |
644 | ret = spufs_create_gang(nd->path.dentry->d_inode, | 638 | ret = spufs_create_gang(path->dentry->d_inode, |
645 | dentry, nd->path.mnt, mode); | 639 | dentry, path->mnt, mode); |
646 | else | 640 | else |
647 | ret = spufs_create_context(nd->path.dentry->d_inode, | 641 | ret = spufs_create_context(path->dentry->d_inode, |
648 | dentry, nd->path.mnt, flags, mode, | 642 | dentry, path->mnt, flags, mode, |
649 | filp); | 643 | filp); |
650 | if (ret >= 0) | 644 | if (ret >= 0) |
651 | fsnotify_mkdir(nd->path.dentry->d_inode, dentry); | 645 | fsnotify_mkdir(path->dentry->d_inode, dentry); |
652 | return ret; | 646 | return ret; |
653 | 647 | ||
654 | out_dir: | ||
655 | mutex_unlock(&nd->path.dentry->d_inode->i_mutex); | ||
656 | out: | 648 | out: |
649 | mutex_unlock(&path->dentry->d_inode->i_mutex); | ||
657 | return ret; | 650 | return ret; |
658 | } | 651 | } |
659 | 652 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index c448bac65518..099245f230b2 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h | |||
@@ -248,7 +248,7 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[]; | |||
248 | /* system call implementation */ | 248 | /* system call implementation */ |
249 | extern struct spufs_calls spufs_calls; | 249 | extern struct spufs_calls spufs_calls; |
250 | long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); | 250 | long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); |
251 | long spufs_create(struct nameidata *nd, unsigned int flags, | 251 | long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags, |
252 | mode_t mode, struct file *filp); | 252 | mode_t mode, struct file *filp); |
253 | /* ELF coredump callbacks for writing SPU ELF notes */ | 253 | /* ELF coredump callbacks for writing SPU ELF notes */ |
254 | extern int spufs_coredump_extra_notes_size(void); | 254 | extern int spufs_coredump_extra_notes_size(void); |
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index a3d2ce54ea2e..609e016e92d0 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
@@ -62,21 +62,17 @@ out: | |||
62 | static long do_spu_create(const char __user *pathname, unsigned int flags, | 62 | static long do_spu_create(const char __user *pathname, unsigned int flags, |
63 | mode_t mode, struct file *neighbor) | 63 | mode_t mode, struct file *neighbor) |
64 | { | 64 | { |
65 | char *tmp; | 65 | struct path path; |
66 | struct dentry *dentry; | ||
66 | int ret; | 67 | int ret; |
67 | 68 | ||
68 | tmp = getname(pathname); | 69 | dentry = user_path_create(AT_FDCWD, pathname, &path, 1); |
69 | ret = PTR_ERR(tmp); | 70 | ret = PTR_ERR(dentry); |
70 | if (!IS_ERR(tmp)) { | 71 | if (!IS_ERR(dentry)) { |
71 | struct nameidata nd; | 72 | ret = spufs_create(&path, dentry, flags, mode, neighbor); |
72 | 73 | mutex_unlock(&path.dentry->d_inode->i_mutex); | |
73 | ret = kern_path_parent(tmp, &nd); | 74 | dput(dentry); |
74 | if (!ret) { | 75 | path_put(&path); |
75 | nd.flags |= LOOKUP_OPEN | LOOKUP_CREATE; | ||
76 | ret = spufs_create(&nd, flags, mode, neighbor); | ||
77 | path_put(&nd.path); | ||
78 | } | ||
79 | putname(tmp); | ||
80 | } | 76 | } |
81 | 77 | ||
82 | return ret; | 78 | return ret; |