Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 251791
b: refs/heads/master
c: 55e6787
h: refs/heads/master
i:
  251789: dcc43c6
  251787: 9fba5c1
  251783: d4ac77b
  251775: bec92d8
v: v3
  • Loading branch information
Tao Ma authored and Joel Becker committed May 24, 2011
1 parent 44cc8ff commit 3497e2e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e80de36d8dbff216a384e9204e54d59deeadf344
refs/heads/master: 55e67872b67ebd30d1326067cdba53a622ab497d
24 changes: 24 additions & 0 deletions trunk/fs/ocfs2/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,29 @@ long ocfs2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
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;
}
default:
return -ENOTTY;
}
Expand Down Expand Up @@ -569,6 +592,7 @@ long ocfs2_compat_ioctl(struct file *file, unsigned cmd, unsigned long arg)
case OCFS2_IOC_GROUP_EXTEND:
case OCFS2_IOC_GROUP_ADD:
case OCFS2_IOC_GROUP_ADD64:
case FITRIM:
break;
case OCFS2_IOC_REFLINK:
if (copy_from_user(&args, (struct reflink_arguments *)arg,
Expand Down

0 comments on commit 3497e2e

Please sign in to comment.