Lines Matching +full:- +full:- +full:trim +full:- +full:-

1 // SPDX-License-Identifier: GPL-2.0
31 struct block_device *bdev = mp->m_ddev_targp->bt_bdev; in xfs_trim_extents()
51 agf = agbp->b_addr; in xfs_trim_extents()
58 error = xfs_alloc_lookup_ge(cur, 0, be32_to_cpu(agf->agf_longest), &i); in xfs_trim_extents()
76 error = -EFSCORRUPTED; in xfs_trim_extents()
79 ASSERT(flen <= be32_to_cpu(agf->agf_longest)); in xfs_trim_extents()
99 * supposed to discard skip it. Do not bother to trim in xfs_trim_extents()
128 error = -ERESTARTSYS; in xfs_trim_extents()
142 * trim a range of the filesystem.
148 * comparisons for determining the correct offset and regions to trim.
155 struct request_queue *q = bdev_get_queue(mp->m_ddev_targp->bt_bdev); in xfs_ioc_trim()
156 unsigned int granularity = q->limits.discard_granularity; in xfs_ioc_trim()
164 return -EPERM; in xfs_ioc_trim()
166 return -EOPNOTSUPP; in xfs_ioc_trim()
169 * We haven't recovered the log, so we cannot use our bnobt-guided in xfs_ioc_trim()
172 if (mp->m_flags & XFS_MOUNT_NORECOVERY) in xfs_ioc_trim()
173 return -EROFS; in xfs_ioc_trim()
176 return -EFAULT; in xfs_ioc_trim()
187 if (range.start >= XFS_FSB_TO_B(mp, mp->m_sb.sb_dblocks) || in xfs_ioc_trim()
188 range.minlen > XFS_FSB_TO_B(mp, mp->m_ag_max_usable) || in xfs_ioc_trim()
189 range.len < mp->m_sb.sb_blocksize) in xfs_ioc_trim()
190 return -EINVAL; in xfs_ioc_trim()
193 end = start + BTOBBT(range.len) - 1; in xfs_ioc_trim()
195 if (end > XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks) - 1) in xfs_ioc_trim()
196 end = XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks)- 1; in xfs_ioc_trim()
206 if (error == -ERESTARTSYS) in xfs_ioc_trim()
216 return -EFAULT; in xfs_ioc_trim()