summaryrefslogtreecommitdiff
path: root/fs/bcachefs/fs.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-11-29 02:14:31 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:12 -0400
commitf0cfb963ec0370b021bb21c899b5fdcd020014cf (patch)
treefd9b731954ec2015bae0bea2197e816a662ea4eb /fs/bcachefs/fs.c
parent26609b619fa2301eb7eb5855a7005d99f8a07a73 (diff)
downloadlwn-f0cfb963ec0370b021bb21c899b5fdcd020014cf.tar.gz
lwn-f0cfb963ec0370b021bb21c899b5fdcd020014cf.zip
bcachefs: Track nr_inodes with the key marking machinery
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/fs.c')
-rw-r--r--fs/bcachefs/fs.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/fs/bcachefs/fs.c b/fs/bcachefs/fs.c
index 93e1f3aaacd4..db3c5962ad31 100644
--- a/fs/bcachefs/fs.c
+++ b/fs/bcachefs/fs.c
@@ -400,8 +400,6 @@ retry:
if (unlikely(ret))
goto err_trans;
- atomic_long_inc(&c->nr_inodes);
-
if (!tmpfile) {
bch2_inode_update_after_write(c, dir, &dir_u,
ATTR_MTIME|ATTR_CTIME);
@@ -1418,9 +1416,6 @@ static void bch2_evict_inode(struct inode *vinode)
bch2_quota_acct(c, inode->ei_qid, Q_INO, -1,
KEY_TYPE_QUOTA_WARN);
bch2_inode_rm(c, inode->v.i_ino);
-
- WARN_ONCE(atomic_long_dec_return(&c->nr_inodes) < 0,
- "nr_inodes < 0");
}
}
@@ -1439,7 +1434,7 @@ static int bch2_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_blocks = (c->capacity - hidden_metadata) >> shift;
buf->f_bfree = (c->capacity - bch2_fs_sectors_used(c, usage)) >> shift;
buf->f_bavail = buf->f_bfree;
- buf->f_files = atomic_long_read(&c->nr_inodes);
+ buf->f_files = usage.nr_inodes;
buf->f_ffree = U64_MAX;
fsid = le64_to_cpup((void *) c->sb.user_uuid.b) ^