Lines Matching +full:- +full:- +full:trim +full:- +full:-
1 // SPDX-License-Identifier: GPL-2.0-or-later
20 * FUNCTION: TRIM the specified block range on device, if supported
23 * ip - pointer to in-core inode
24 * blkno - starting block number to be trimmed (0..N)
25 * nblocks - number of blocks to be trimmed
34 struct super_block *sb = ip->i_sb; in jfs_issue_discard()
54 * FUNCTION: attempt to discard (TRIM) all free blocks from the
58 * ip - pointer to in-core inode;
59 * range - the range, given by user space
62 * 0 - success
63 * -EIO - i/o error
67 struct inode *ipbmap = JFS_SBI(ip->i_sb)->ipbmap; in jfs_ioc_trim()
68 struct bmap *bmp = JFS_SBI(ip->i_sb)->bmap; in jfs_ioc_trim()
69 struct super_block *sb = ipbmap->i_sb; in jfs_ioc_trim()
76 * start: First Byte to trim in jfs_ioc_trim()
77 * len: number of Bytes to trim from start in jfs_ioc_trim()
80 start = range->start >> sb->s_blocksize_bits; in jfs_ioc_trim()
81 end = start + (range->len >> sb->s_blocksize_bits) - 1; in jfs_ioc_trim()
82 minlen = range->minlen >> sb->s_blocksize_bits; in jfs_ioc_trim()
86 if (minlen > bmp->db_agsize || in jfs_ioc_trim()
87 start >= bmp->db_mapsize || in jfs_ioc_trim()
88 range->len < sb->s_blocksize) in jfs_ioc_trim()
89 return -EINVAL; in jfs_ioc_trim()
91 if (end >= bmp->db_mapsize) in jfs_ioc_trim()
92 end = bmp->db_mapsize - 1; in jfs_ioc_trim()
95 * we trim all ag's within the range in jfs_ioc_trim()
97 agno = BLKTOAG(start, JFS_SBI(ip->i_sb)); in jfs_ioc_trim()
98 agno_end = BLKTOAG(end, JFS_SBI(ip->i_sb)); in jfs_ioc_trim()
103 range->len = trimmed << sb->s_blocksize_bits; in jfs_ioc_trim()