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>
This commit is contained in:
Russell King
2019-06-04 14:49:36 +01:00
committed by Al Viro
parent 1dfdfc9473
commit 275f5b99d6
2 changed files with 9 additions and 15 deletions

View File

@@ -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);
}