Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/shaggy/jfs-2.6:
BKL-removal: Implement a compat_ioctl handler for JFS
BKL-removal: Use unlocked_ioctl for jfs

+40 -7
+4 -1
fs/jfs/file.c
··· 112 112 .splice_write = generic_file_splice_write, 113 113 .fsync = jfs_fsync, 114 114 .release = jfs_release, 115 - .ioctl = jfs_ioctl, 115 + .unlocked_ioctl = jfs_ioctl, 116 + #ifdef CONFIG_COMPAT 117 + .compat_ioctl = jfs_compat_ioctl, 118 + #endif 116 119 };
+28 -3
fs/jfs/ioctl.c
··· 51 51 } 52 52 53 53 54 - int jfs_ioctl(struct inode * inode, struct file * filp, unsigned int cmd, 55 - unsigned long arg) 54 + long jfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 56 55 { 56 + struct inode *inode = filp->f_dentry->d_inode; 57 57 struct jfs_inode_info *jfs_inode = JFS_IP(inode); 58 58 unsigned int flags; 59 59 ··· 82 82 /* Is it quota file? Do not allow user to mess with it */ 83 83 if (IS_NOQUOTA(inode)) 84 84 return -EPERM; 85 + 86 + /* Lock against other parallel changes of flags */ 87 + mutex_lock(&inode->i_mutex); 88 + 85 89 jfs_get_inode_flags(jfs_inode); 86 90 oldflags = jfs_inode->mode2; 87 91 ··· 96 92 if ((oldflags & JFS_IMMUTABLE_FL) || 97 93 ((flags ^ oldflags) & 98 94 (JFS_APPEND_FL | JFS_IMMUTABLE_FL))) { 99 - if (!capable(CAP_LINUX_IMMUTABLE)) 95 + if (!capable(CAP_LINUX_IMMUTABLE)) { 96 + mutex_unlock(&inode->i_mutex); 100 97 return -EPERM; 98 + } 101 99 } 102 100 103 101 flags = flags & JFS_FL_USER_MODIFIABLE; ··· 107 101 jfs_inode->mode2 = flags; 108 102 109 103 jfs_set_inode_flags(inode); 104 + mutex_unlock(&inode->i_mutex); 110 105 inode->i_ctime = CURRENT_TIME_SEC; 111 106 mark_inode_dirty(inode); 112 107 return 0; ··· 117 110 } 118 111 } 119 112 113 + #ifdef CONFIG_COMPAT 114 + long jfs_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) 115 + { 116 + /* While these ioctl numbers defined with 'long' and have different 117 + * numbers than the 64bit ABI, 118 + * the actual implementation only deals with ints and is compatible. 119 + */ 120 + switch (cmd) { 121 + case JFS_IOC_GETFLAGS32: 122 + cmd = JFS_IOC_GETFLAGS; 123 + break; 124 + case JFS_IOC_SETFLAGS32: 125 + cmd = JFS_IOC_SETFLAGS; 126 + break; 127 + } 128 + return jfs_ioctl(filp, cmd, arg); 129 + } 130 + #endif
+2
fs/jfs/jfs_dinode.h
··· 170 170 #define JFS_IOC_GETFLAGS _IOR('f', 1, long) 171 171 #define JFS_IOC_SETFLAGS _IOW('f', 2, long) 172 172 173 + #define JFS_IOC_GETFLAGS32 _IOR('f', 1, int) 174 + #define JFS_IOC_SETFLAGS32 _IOW('f', 2, int) 173 175 174 176 #endif /*_H_JFS_DINODE */
+2 -2
fs/jfs/jfs_inode.h
··· 22 22 23 23 extern struct inode *ialloc(struct inode *, umode_t); 24 24 extern int jfs_fsync(struct file *, struct dentry *, int); 25 - extern int jfs_ioctl(struct inode *, struct file *, 26 - unsigned int, unsigned long); 25 + extern long jfs_ioctl(struct file *, unsigned int, unsigned long); 26 + extern long jfs_compat_ioctl(struct file *, unsigned int, unsigned long); 27 27 extern struct inode *jfs_iget(struct super_block *, unsigned long); 28 28 extern int jfs_commit_inode(struct inode *, int); 29 29 extern int jfs_write_inode(struct inode*, int);
+4 -1
fs/jfs/namei.c
··· 1556 1556 .read = generic_read_dir, 1557 1557 .readdir = jfs_readdir, 1558 1558 .fsync = jfs_fsync, 1559 - .ioctl = jfs_ioctl, 1559 + .unlocked_ioctl = jfs_ioctl, 1560 + #ifdef CONFIG_COMPAT 1561 + .compat_ioctl = jfs_compat_ioctl, 1562 + #endif 1560 1563 }; 1561 1564 1562 1565 static int jfs_ci_hash(struct dentry *dir, struct qstr *this)