From: Joel Becker Date: Thu, 26 May 2011 04:51:55 +0000 (-0700) Subject: Merge branch 'move_extents' of git://oss.oracle.com/git/tye/linux-2.6 into ocfs2... X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ece928df16494becd43f999aff9bd530182e7e81;p=linux-beck.git Merge branch 'move_extents' of git://oss.oracle.com/git/tye/linux-2.6 into ocfs2-merge-window Conflicts: fs/ocfs2/ioctl.c --- ece928df16494becd43f999aff9bd530182e7e81 diff --cc fs/ocfs2/ioctl.c index 312a28f433a4,59100598b0cb..bc91072b7219 --- a/fs/ocfs2/ioctl.c +++ b/fs/ocfs2/ioctl.c @@@ -542,29 -952,8 +952,31 @@@ long ocfs2_ioctl(struct file *filp, uns return -EFAULT; return ocfs2_info_handle(inode, &info, 0); + case FITRIM: + { + struct super_block *sb = inode->i_sb; + struct fstrim_range range; + int ret = 0; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + if (copy_from_user(&range, (struct fstrim_range *)arg, + sizeof(range))) + return -EFAULT; + + ret = ocfs2_trim_fs(sb, &range); + if (ret < 0) + return ret; + + if (copy_to_user((struct fstrim_range *)arg, &range, + sizeof(range))) + return -EFAULT; + + return 0; + } + case OCFS2_IOC_MOVE_EXT: + return ocfs2_ioctl_move_extents(filp, (void __user *)arg); default: return -ENOTTY; }