mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/2 v2] f2fs: show precise # of blocks that user/root can use
Date: Wed, 3 Jan 2018 22:50:50 -0800	[thread overview]
Message-ID: <20180104065050.GA54234@jaegeuk-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <20180103185845.29953-1-jaegeuk@kernel.org>

Let's show precise # of blocks that user/root can use through bavail and bfree
respectively.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---

Change log from v1:
 - clean up obsolete values

 fs/f2fs/super.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 0a820ba55b10..f1300cda6bfd 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -994,20 +994,19 @@ static int f2fs_statfs(struct dentry *dentry, struct kstatfs *buf)
 	struct super_block *sb = dentry->d_sb;
 	struct f2fs_sb_info *sbi = F2FS_SB(sb);
 	u64 id = huge_encode_dev(sb->s_bdev->bd_dev);
-	block_t total_count, user_block_count, start_count, ovp_count;
+	block_t total_count, user_block_count, start_count;
 	u64 avail_node_count;
 
 	total_count = le64_to_cpu(sbi->raw_super->block_count);
 	user_block_count = sbi->user_block_count;
 	start_count = le32_to_cpu(sbi->raw_super->segment0_blkaddr);
-	ovp_count = SM_I(sbi)->ovp_segments << sbi->log_blocks_per_seg;
 	buf->f_type = F2FS_SUPER_MAGIC;
 	buf->f_bsize = sbi->blocksize;
 
 	buf->f_blocks = total_count - start_count;
-	buf->f_bfree = user_block_count - valid_user_blocks(sbi) + ovp_count;
-	buf->f_bavail = user_block_count - valid_user_blocks(sbi) -
+	buf->f_bfree = user_block_count - valid_user_blocks(sbi) -
 						sbi->current_reserved_blocks;
+	buf->f_bavail = buf->f_bfree;
 
 	avail_node_count = sbi->total_node_count - sbi->nquota_files -
 						F2FS_RESERVED_NODE_NUM;
-- 
2.15.0.531.g2ccb3012c9-goog

  parent reply	other threads:[~2018-01-04  6:50 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-03 18:58 [PATCH 1/2] " Jaegeuk Kim
2018-01-03 18:58 ` [PATCH 2/2] f2fs: add reserved blocks for root user Jaegeuk Kim
2018-01-04  6:51   ` [PATCH 2/2 v2] " Jaegeuk Kim
2018-01-04  7:21     ` [f2fs-dev] " Chao Yu
2018-01-05  4:43     ` [PATCH 2/2 v3] " Jaegeuk Kim
2018-01-05  8:04   ` [f2fs-dev] [PATCH 2/2] " Yunlong Song
2018-01-04  1:12 ` [f2fs-dev] [PATCH 1/2] f2fs: show precise # of blocks that user/root can use Chao Yu
2018-01-04  6:50 ` Jaegeuk Kim [this message]
2018-01-04  7:20   ` [f2fs-dev] [PATCH 1/2 v2] " Chao Yu
2018-01-05  7:05 ` [f2fs-dev] [PATCH 1/2] " Yunlong Song
2018-01-08 11:23   ` Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180104065050.GA54234@jaegeuk-macbookpro.roam.corp.google.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®