From 0528979fa7ab7853faaf2ecf34b7721dd4c0b383 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 10 May 2020 11:39:57 -0600 Subject: part: Drop disk_partition_t typedef We should not be using typedefs and these make it harder to use forward declarations (to reduce header file inclusions). Drop the typedef. Signed-off-by: Simon Glass --- fs/btrfs/btrfs.c | 3 ++- fs/btrfs/btrfs.h | 2 +- fs/btrfs/dev.c | 2 +- fs/ext4/dev.c | 4 ++-- fs/ext4/ext4fs.c | 2 +- fs/fat/fat.c | 6 +++--- fs/fs.c | 6 +++--- fs/fs_internal.c | 2 +- fs/reiserfs/dev.c | 4 ++-- fs/sandbox/sandboxfs.c | 2 +- fs/ubifs/ubifs.c | 2 +- fs/zfs/dev.c | 4 ++-- 12 files changed, 20 insertions(+), 19 deletions(-) (limited to 'fs') diff --git a/fs/btrfs/btrfs.c b/fs/btrfs/btrfs.c index 2e3985e..de16217 100644 --- a/fs/btrfs/btrfs.c +++ b/fs/btrfs/btrfs.c @@ -75,7 +75,8 @@ static int readdir_callback(const struct btrfs_root *root, return 0; } -int btrfs_probe(struct blk_desc *fs_dev_desc, disk_partition_t *fs_partition) +int btrfs_probe(struct blk_desc *fs_dev_desc, + struct disk_partition *fs_partition) { btrfs_blk_desc = fs_dev_desc; btrfs_part_info = fs_partition; diff --git a/fs/btrfs/btrfs.h b/fs/btrfs/btrfs.h index 986d078..25a8cf6 100644 --- a/fs/btrfs/btrfs.h +++ b/fs/btrfs/btrfs.h @@ -36,7 +36,7 @@ static inline u64 btrfs_name_hash(const char *name, int len) /* dev.c */ extern struct blk_desc *btrfs_blk_desc; -extern disk_partition_t *btrfs_part_info; +extern struct disk_partition *btrfs_part_info; int btrfs_devread(u64, int, void *); diff --git a/fs/btrfs/dev.c b/fs/btrfs/dev.c index ada3800..e686abc 100644 --- a/fs/btrfs/dev.c +++ b/fs/btrfs/dev.c @@ -10,7 +10,7 @@ #include struct blk_desc *btrfs_blk_desc; -disk_partition_t *btrfs_part_info; +struct disk_partition *btrfs_part_info; int btrfs_devread(u64 address, int byte_len, void *buf) { diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c index 2907688..0d4f756 100644 --- a/fs/ext4/dev.c +++ b/fs/ext4/dev.c @@ -33,9 +33,9 @@ lbaint_t part_offset; static struct blk_desc *ext4fs_blk_desc; -static disk_partition_t *part_info; +static struct disk_partition *part_info; -void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) +void ext4fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info) { assert(rbdd->blksz == (1 << rbdd->log2blksz)); ext4fs_blk_desc = rbdd; diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c index 96ca276..ad71f5a 100644 --- a/fs/ext4/ext4fs.c +++ b/fs/ext4/ext4fs.c @@ -227,7 +227,7 @@ int ext4fs_read(char *buf, loff_t offset, loff_t len, loff_t *actread) } int ext4fs_probe(struct blk_desc *fs_dev_desc, - disk_partition_t *fs_partition) + struct disk_partition *fs_partition) { ext4fs_set_blk_dev(fs_dev_desc, fs_partition); diff --git a/fs/fat/fat.c b/fs/fat/fat.c index f68c8f7..425d877 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -36,7 +36,7 @@ static void downcase(char *str, size_t len) } static struct blk_desc *cur_dev; -static disk_partition_t cur_part_info; +static struct disk_partition cur_part_info; #define DOS_BOOT_MAGIC_OFFSET 0x1fe #define DOS_FS_TYPE_OFFSET 0x36 @@ -57,7 +57,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf) return ret; } -int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info) +int fat_set_blk_dev(struct blk_desc *dev_desc, struct disk_partition *info) { ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz); @@ -88,7 +88,7 @@ int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info) int fat_register_device(struct blk_desc *dev_desc, int part_no) { - disk_partition_t info; + struct disk_partition info; /* First close any currently found FAT filesystem */ cur_dev = NULL; diff --git a/fs/fs.c b/fs/fs.c index 0c66d60..e3de25d 100644 --- a/fs/fs.c +++ b/fs/fs.c @@ -24,11 +24,11 @@ DECLARE_GLOBAL_DATA_PTR; static struct blk_desc *fs_dev_desc; static int fs_dev_part; -static disk_partition_t fs_partition; +static struct disk_partition fs_partition; static int fs_type = FS_TYPE_ANY; static inline int fs_probe_unsupported(struct blk_desc *fs_dev_desc, - disk_partition_t *fs_partition) + struct disk_partition *fs_partition) { printf("** Unrecognized filesystem type **\n"); return -1; @@ -135,7 +135,7 @@ struct fstype_info { */ bool null_dev_desc_ok; int (*probe)(struct blk_desc *fs_dev_desc, - disk_partition_t *fs_partition); + struct disk_partition *fs_partition); int (*ls)(const char *dirname); int (*exists)(const char *filename); int (*size)(const char *filename, loff_t *size); diff --git a/fs/fs_internal.c b/fs/fs_internal.c index d369c43..1ff804d 100644 --- a/fs/fs_internal.c +++ b/fs/fs_internal.c @@ -10,7 +10,7 @@ #include #include -int fs_devread(struct blk_desc *blk, disk_partition_t *partition, +int fs_devread(struct blk_desc *blk, struct disk_partition *partition, lbaint_t sector, int byte_offset, int byte_len, char *buf) { unsigned block_len; diff --git a/fs/reiserfs/dev.c b/fs/reiserfs/dev.c index c6b6779..5d9c264 100644 --- a/fs/reiserfs/dev.c +++ b/fs/reiserfs/dev.c @@ -12,10 +12,10 @@ #include "reiserfs_private.h" static struct blk_desc *reiserfs_blk_desc; -static disk_partition_t *part_info; +static struct disk_partition *part_info; -void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) +void reiserfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info) { reiserfs_blk_desc = rbdd; part_info = info; diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c index af47224..5851fe2 100644 --- a/fs/sandbox/sandboxfs.c +++ b/fs/sandbox/sandboxfs.c @@ -8,7 +8,7 @@ #include #include -int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) +int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info) { /* * Only accept a NULL struct blk_desc for the sandbox, which is when diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c index e097d28..742c2f4 100644 --- a/fs/ubifs/ubifs.c +++ b/fs/ubifs/ubifs.c @@ -549,7 +549,7 @@ static unsigned long ubifs_findfile(struct super_block *sb, char *filename) return 0; } -int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) +int ubifs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info) { if (rbdd) { debug("UBIFS cannot be used with normal block devices\n"); diff --git a/fs/zfs/dev.c b/fs/zfs/dev.c index 3cdb9e0..251e7d1 100644 --- a/fs/zfs/dev.c +++ b/fs/zfs/dev.c @@ -14,9 +14,9 @@ #include static struct blk_desc *zfs_blk_desc; -static disk_partition_t *part_info; +static struct disk_partition *part_info; -void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) +void zfs_set_blk_dev(struct blk_desc *rbdd, struct disk_partition *info) { zfs_blk_desc = rbdd; part_info = info; -- cgit v1.1