aboutsummaryrefslogtreecommitdiffstats
path: root/fs/adfs/map.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-12-09 11:08:34 +0000
committerAl Viro <viro@zeniv.linux.org.uk>2020-01-20 20:12:40 -0500
commite6160e469f56a23cb69e1dc37aa0d895bf29ac24 (patch)
treec1f9c669869837ac2e66c035b315742486be067f /fs/adfs/map.c
parentfs/adfs: map: move map reading and validation to map.c (diff)
downloadlinux-dev-e6160e469f56a23cb69e1dc37aa0d895bf29ac24.tar.xz
linux-dev-e6160e469f56a23cb69e1dc37aa0d895bf29ac24.zip
fs/adfs: map: rename adfs_map_free() to adfs_map_statfs()
adfs_map_free() is not obvious whether it is freeing the map or returning the number of free blocks on the filesystem. Rename it to the more generic statfs() to make it clear that it's a statistic function. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs/map.c')
-rw-r--r--fs/adfs/map.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/adfs/map.c b/fs/adfs/map.c
index 120e01451e75..c322d37e8f91 100644
--- a/fs/adfs/map.c
+++ b/fs/adfs/map.c
@@ -5,6 +5,7 @@
* Copyright (C) 1997-2002 Russell King
*/
#include <linux/slab.h>
+#include <linux/statfs.h>
#include <asm/unaligned.h>
#include "adfs.h"
@@ -221,10 +222,10 @@ found:
* total_free = E(free_in_zone_n)
* nzones
*/
-unsigned int
-adfs_map_free(struct super_block *sb)
+void adfs_map_statfs(struct super_block *sb, struct kstatfs *buf)
{
struct adfs_sb_info *asb = ADFS_SB(sb);
+ struct adfs_discrecord *dr = adfs_map_discrecord(asb->s_map);
struct adfs_discmap *dm;
unsigned int total = 0;
unsigned int zone;
@@ -236,7 +237,10 @@ adfs_map_free(struct super_block *sb)
total += scan_free_map(asb, dm++);
} while (--zone > 0);
- return signed_asl(total, asb->s_map2blk);
+ buf->f_blocks = adfs_disc_size(dr) >> sb->s_blocksize_bits;
+ buf->f_files = asb->s_ids_per_zone * asb->s_map_size;
+ buf->f_bavail =
+ buf->f_bfree = signed_asl(total, asb->s_map2blk);
}
int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset)