summaryrefslogtreecommitdiffstats
path: root/fs/udf
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2020-01-17 12:36:38 +0100
committerJan Kara <jack@suse.cz>2020-01-20 13:59:41 +0100
commit356557be8670ffdb6dc01cc2702e3614bcf64310 (patch)
tree31608986a57066a93c13d6a1f7161b13e1937d66 /fs/udf
parent15fb05fd286ac57a0802d71624daeb5c1c2d5b07 (diff)
downloadlinux-356557be8670ffdb6dc01cc2702e3614bcf64310.tar.bz2
udf: Clarify meaning of f_files in udf_statfs
UDF does not have separate preallocated table of inodes. So similarly to XFS we pretend that every free block is also a free inode in statfs(2) output. Clarify this in a comment. Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r--fs/udf/super.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index fd96d7bfc0e4..f747bf72edbe 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -2402,6 +2402,10 @@ static int udf_statfs(struct dentry *dentry, struct kstatfs *buf)
buf->f_blocks = sbi->s_partmaps[sbi->s_partition].s_partition_len;
buf->f_bfree = udf_count_free(sb);
buf->f_bavail = buf->f_bfree;
+ /*
+ * Let's pretend each free block is also a free 'inode' since UDF does
+ * not have separate preallocated table of inodes.
+ */
buf->f_files = (lvidiu != NULL ? (le32_to_cpu(lvidiu->numFiles) +
le32_to_cpu(lvidiu->numDirs)) : 0)
+ buf->f_bfree;