diff options
author | Takashi Iwai <tiwai@suse.de> | 2014-01-05 11:19:34 +0100 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2014-01-05 11:19:34 +0100 |
commit | 4b5a5096bb834102b2e821f5f34274f041862d67 (patch) | |
tree | fe55f4f11111e34d503a6a01aeb4bfc2eae5e88a /fs/xfs/xfs_discard.c | |
parent | 19570d747795f0ecff79403698b868dc5ad7fa86 (diff) | |
parent | 150116bcfbd9004f01e682535baddaca2b90d3b2 (diff) | |
download | linux-4b5a5096bb834102b2e821f5f34274f041862d67.tar.gz linux-4b5a5096bb834102b2e821f5f34274f041862d67.tar.bz2 linux-4b5a5096bb834102b2e821f5f34274f041862d67.zip |
Merge branch 'for-linus' into for-next
Diffstat (limited to 'fs/xfs/xfs_discard.c')
-rw-r--r-- | fs/xfs/xfs_discard.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c index 8367d6dc18c9..4f11ef011139 100644 --- a/fs/xfs/xfs_discard.c +++ b/fs/xfs/xfs_discard.c @@ -157,7 +157,7 @@ xfs_ioc_trim( struct xfs_mount *mp, struct fstrim_range __user *urange) { - struct request_queue *q = mp->m_ddev_targp->bt_bdev->bd_disk->queue; + struct request_queue *q = bdev_get_queue(mp->m_ddev_targp->bt_bdev); unsigned int granularity = q->limits.discard_granularity; struct fstrim_range range; xfs_daddr_t start, end, minlen; @@ -180,7 +180,8 @@ xfs_ioc_trim( * matter as trimming blocks is an advisory interface. */ if (range.start >= XFS_FSB_TO_B(mp, mp->m_sb.sb_dblocks) || - range.minlen > XFS_FSB_TO_B(mp, XFS_ALLOC_AG_MAX_USABLE(mp))) + range.minlen > XFS_FSB_TO_B(mp, XFS_ALLOC_AG_MAX_USABLE(mp)) || + range.len < mp->m_sb.sb_blocksize) return -XFS_ERROR(EINVAL); start = BTOBB(range.start); |