]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - fs/xfs/linux-2.6/xfs_discard.c
Merge branch 'for-linus' of git://neil.brown.name/md
[mv-sheeva.git] / fs / xfs / linux-2.6 / xfs_discard.c
index 05201ae719e5f2054bb3527e30ead2e8a41f12ff..d61611c88012c8daaab1840f9534983fac62bd2d 100644 (file)
@@ -152,6 +152,8 @@ xfs_ioc_trim(
 
        if (!capable(CAP_SYS_ADMIN))
                return -XFS_ERROR(EPERM);
+       if (!blk_queue_discard(q))
+               return -XFS_ERROR(EOPNOTSUPP);
        if (copy_from_user(&range, urange, sizeof(range)))
                return -XFS_ERROR(EFAULT);