Skip to content

Commit f768dc3

Browse files
bbkzzjankara
authored andcommitted
udf: use wrapper i_blocksize() in udf_discard_prealloc()
Convert to use i_blocksize() for readability. Signed-off-by: Yangtao Li <frank.li@vivo.com> Signed-off-by: Jan Kara <jack@suse.cz> Message-Id: <20230310030821.66090-2-frank.li@vivo.com>
1 parent 96acbef commit f768dc3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

fs/udf/truncate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ void udf_discard_prealloc(struct inode *inode)
127127
uint64_t lbcount = 0;
128128
int8_t etype = -1;
129129
struct udf_inode_info *iinfo = UDF_I(inode);
130-
int bsize = 1 << inode->i_blkbits;
130+
int bsize = i_blocksize(inode);
131131

132132
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
133133
ALIGN(inode->i_size, bsize) == ALIGN(iinfo->i_lenExtents, bsize))
@@ -149,7 +149,7 @@ void udf_discard_prealloc(struct inode *inode)
149149
lbcount -= elen;
150150
udf_delete_aext(inode, prev_epos);
151151
udf_free_blocks(inode->i_sb, inode, &eloc, 0,
152-
DIV_ROUND_UP(elen, 1 << inode->i_blkbits));
152+
DIV_ROUND_UP(elen, bsize));
153153
}
154154
/* This inode entry is in-memory only and thus we don't have to mark
155155
* the inode dirty */

0 commit comments

Comments
 (0)