udf: use wrapper i_blocksize() in udf_discard_prealloc()
authorYangtao Li <frank.li@vivo.com>
Fri, 10 Mar 2023 03:08:20 +0000 (11:08 +0800)
committerJan Kara <jack@suse.cz>
Mon, 13 Mar 2023 10:16:16 +0000 (11:16 +0100)
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>

fs/udf/truncate.c

index 871856c..2e7ba23 100644 (file)
@@ -127,7 +127,7 @@ void udf_discard_prealloc(struct inode *inode)
        uint64_t lbcount = 0;
        int8_t etype = -1;
        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 ||
            ALIGN(inode->i_size, bsize) == ALIGN(iinfo->i_lenExtents, bsize))
@@ -149,7 +149,7 @@ void udf_discard_prealloc(struct inode *inode)
                lbcount -= elen;
                udf_delete_aext(inode, prev_epos);
                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
         * the inode dirty */