From 1dfdfc94730bde781c87b25fd606f6dfaffe9097 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 4 Jun 2019 14:49:30 +0100 Subject: fs/adfs: add helper to get discrecord from map Add a helper to get the disc record from the map, rather than open coding this in adfs_fill_super(). Signed-off-by: Russell King Signed-off-by: Al Viro --- fs/adfs/map.c | 1 - 1 file changed, 1 deletion(-) (limited to 'fs/adfs/map.c') diff --git a/fs/adfs/map.c b/fs/adfs/map.c index 6935f05202ac..5f2d9d775305 100644 --- a/fs/adfs/map.c +++ b/fs/adfs/map.c @@ -7,7 +7,6 @@ * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ -#include #include #include "adfs.h" -- cgit From 5ed70bb47767d1f57a5e85e585a327917ded0373 Mon Sep 17 00:00:00 2001 From: Russell King Date: Tue, 4 Jun 2019 14:49:57 +0100 Subject: fs/adfs: clean up indirect disc addresses and fragment IDs We use a variety of different names for the indirect disc address of the current object, use a variety of different types, and print it in a variety of different ways. Bring some consistency to this by naming it "indaddr", use u32 or __u32 as the type since it fits in 32-bits, and always print it with %06x (with no leading hex prefix.) When printing it was a directory identifer, use "dir %06x" otherwise use "object %06x". Do the same for fragment IDs and the parent indirect disc addresses. Signed-off-by: Russell King Signed-off-by: Al Viro --- fs/adfs/map.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'fs/adfs/map.c') diff --git a/fs/adfs/map.c b/fs/adfs/map.c index 5f2d9d775305..e8f70f7c384e 100644 --- a/fs/adfs/map.c +++ b/fs/adfs/map.c @@ -66,9 +66,8 @@ static DEFINE_RWLOCK(adfs_map_lock); * output of: * gcc -D__KERNEL__ -O2 -I../../include -o - -S map.c */ -static int -lookup_zone(const struct adfs_discmap *dm, const unsigned int idlen, - const unsigned int frag_id, unsigned int *offset) +static int lookup_zone(const struct adfs_discmap *dm, const unsigned int idlen, + const u32 frag_id, unsigned int *offset) { const unsigned int mapsize = dm->dm_endbit; const u32 idmask = (1 << idlen) - 1; @@ -187,9 +186,8 @@ error: return 0; } -static int -scan_map(struct adfs_sb_info *asb, unsigned int zone, - const unsigned int frag_id, unsigned int mapoff) +static int scan_map(struct adfs_sb_info *asb, unsigned int zone, + const u32 frag_id, unsigned int mapoff) { const unsigned int idlen = asb->s_idlen; struct adfs_discmap *dm, *dm_end; @@ -243,9 +241,7 @@ adfs_map_free(struct super_block *sb) return signed_asl(total, asb->s_map2blk); } -int -adfs_map_lookup(struct super_block *sb, unsigned int frag_id, - unsigned int offset) +int adfs_map_lookup(struct super_block *sb, u32 frag_id, unsigned int offset) { struct adfs_sb_info *asb = ADFS_SB(sb); unsigned int zone, mapoff; -- cgit