Commit f768dc3c authored by Yangtao Li's avatar Yangtao Li Committed by Jan Kara

udf: use wrapper i_blocksize() in udf_discard_prealloc()

Convert to use i_blocksize() for readability.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
Message-Id: <20230310030821.66090-2-frank.li@vivo.com>
parent 96acbef6
...@@ -127,7 +127,7 @@ void udf_discard_prealloc(struct inode *inode) ...@@ -127,7 +127,7 @@ void udf_discard_prealloc(struct inode *inode)
uint64_t lbcount = 0; uint64_t lbcount = 0;
int8_t etype = -1; int8_t etype = -1;
struct udf_inode_info *iinfo = UDF_I(inode); struct udf_inode_info *iinfo = UDF_I(inode);
int bsize = 1 << inode->i_blkbits; int bsize = i_blocksize(inode);
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB || if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB ||
ALIGN(inode->i_size, bsize) == ALIGN(iinfo->i_lenExtents, bsize)) ALIGN(inode->i_size, bsize) == ALIGN(iinfo->i_lenExtents, bsize))
...@@ -149,7 +149,7 @@ void udf_discard_prealloc(struct inode *inode) ...@@ -149,7 +149,7 @@ void udf_discard_prealloc(struct inode *inode)
lbcount -= elen; lbcount -= elen;
udf_delete_aext(inode, prev_epos); udf_delete_aext(inode, prev_epos);
udf_free_blocks(inode->i_sb, inode, &eloc, 0, udf_free_blocks(inode->i_sb, inode, &eloc, 0,
DIV_ROUND_UP(elen, 1 << inode->i_blkbits)); DIV_ROUND_UP(elen, bsize));
} }
/* This inode entry is in-memory only and thus we don't have to mark /* This inode entry is in-memory only and thus we don't have to mark
* the inode dirty */ * the inode dirty */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment