f2fs: remove a few bd_part checks
bd_part is never NULL for a block device in use by a file system, so remove the checks. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Hannes Reinecke <hare@suse.de> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Родитель
ad1eaa5344
Коммит
9499ffc752
|
@ -1395,7 +1395,6 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
||||||
__u32 crc32 = 0;
|
__u32 crc32 = 0;
|
||||||
int i;
|
int i;
|
||||||
int cp_payload_blks = __cp_payload(sbi);
|
int cp_payload_blks = __cp_payload(sbi);
|
||||||
struct super_block *sb = sbi->sb;
|
|
||||||
struct curseg_info *seg_i = CURSEG_I(sbi, CURSEG_HOT_NODE);
|
struct curseg_info *seg_i = CURSEG_I(sbi, CURSEG_HOT_NODE);
|
||||||
u64 kbytes_written;
|
u64 kbytes_written;
|
||||||
int err;
|
int err;
|
||||||
|
@ -1489,9 +1488,7 @@ static int do_checkpoint(struct f2fs_sb_info *sbi, struct cp_control *cpc)
|
||||||
start_blk += data_sum_blocks;
|
start_blk += data_sum_blocks;
|
||||||
|
|
||||||
/* Record write statistics in the hot node summary */
|
/* Record write statistics in the hot node summary */
|
||||||
kbytes_written = sbi->kbytes_written;
|
kbytes_written = sbi->kbytes_written + BD_PART_WRITTEN(sbi);
|
||||||
if (sb->s_bdev->bd_part)
|
|
||||||
kbytes_written += BD_PART_WRITTEN(sbi);
|
|
||||||
|
|
||||||
seg_i->journal->info.kbytes_written = cpu_to_le64(kbytes_written);
|
seg_i->journal->info.kbytes_written = cpu_to_le64(kbytes_written);
|
||||||
|
|
||||||
|
|
|
@ -90,11 +90,6 @@ static ssize_t free_segments_show(struct f2fs_attr *a,
|
||||||
static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a,
|
static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a,
|
||||||
struct f2fs_sb_info *sbi, char *buf)
|
struct f2fs_sb_info *sbi, char *buf)
|
||||||
{
|
{
|
||||||
struct super_block *sb = sbi->sb;
|
|
||||||
|
|
||||||
if (!sb->s_bdev->bd_part)
|
|
||||||
return sprintf(buf, "0\n");
|
|
||||||
|
|
||||||
return sprintf(buf, "%llu\n",
|
return sprintf(buf, "%llu\n",
|
||||||
(unsigned long long)(sbi->kbytes_written +
|
(unsigned long long)(sbi->kbytes_written +
|
||||||
BD_PART_WRITTEN(sbi)));
|
BD_PART_WRITTEN(sbi)));
|
||||||
|
@ -103,12 +98,8 @@ static ssize_t lifetime_write_kbytes_show(struct f2fs_attr *a,
|
||||||
static ssize_t features_show(struct f2fs_attr *a,
|
static ssize_t features_show(struct f2fs_attr *a,
|
||||||
struct f2fs_sb_info *sbi, char *buf)
|
struct f2fs_sb_info *sbi, char *buf)
|
||||||
{
|
{
|
||||||
struct super_block *sb = sbi->sb;
|
|
||||||
int len = 0;
|
int len = 0;
|
||||||
|
|
||||||
if (!sb->s_bdev->bd_part)
|
|
||||||
return sprintf(buf, "0\n");
|
|
||||||
|
|
||||||
if (f2fs_sb_has_encrypt(sbi))
|
if (f2fs_sb_has_encrypt(sbi))
|
||||||
len += scnprintf(buf, PAGE_SIZE - len, "%s",
|
len += scnprintf(buf, PAGE_SIZE - len, "%s",
|
||||||
"encryption");
|
"encryption");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче