summaryrefslogtreecommitdiffstats
path: root/fs/adfs/adfs.h
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-06-04 14:49:36 +0100
committerAl Viro <viro@zeniv.linux.org.uk>2019-06-26 20:14:13 -0400
commit275f5b99d6d4e6fccb7cea6783460939856c1306 (patch)
tree9b19ace4d37baa130bafa853bd130c2939cd90a0 /fs/adfs/adfs.h
parent1dfdfc94730bde781c87b25fd606f6dfaffe9097 (diff)
downloadlinux-275f5b99d6d4e6fccb7cea6783460939856c1306.tar.bz2
fs/adfs: add helper to get filesystem size
Add a helper to get the filesystem size from the disc record and eliminate the "s_size" member of the adfs superblock structure. 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/adfs.h')
-rw-r--r--fs/adfs/adfs.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h
index 5a72a0ea03bd..ab13b5dd34a3 100644
--- a/fs/adfs/adfs.h
+++ b/fs/adfs/adfs.h
@@ -58,7 +58,6 @@ struct adfs_sb_info {
__u32 s_ids_per_zone; /* max. no ids in one zone */
__u32 s_idlen; /* length of ID in map */
__u32 s_map_size; /* sector size of a map */
- unsigned long s_size; /* total size (in blocks) of this fs */
signed int s_map2blk; /* shift left by this for map->sector*/
unsigned int s_log2sharesize;/* log2 share size */
__le32 s_version; /* disc format version */
@@ -201,3 +200,9 @@ struct adfs_discrecord *adfs_map_discrecord(struct adfs_discmap *dm)
{
return (void *)(dm[0].dm_bh->b_data + 4);
}
+
+static inline u64 adfs_disc_size(const struct adfs_discrecord *dr)
+{
+ return (u64)le32_to_cpu(dr->disc_size_high) << 32 |
+ le32_to_cpu(dr->disc_size);
+}