From 4101f6879256720b30df712089a3df18565f9203 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 29 Feb 2016 15:25:34 -0700 Subject: dm: Drop the block_dev_desc_t typedef Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass Reviewed-by: Bin Meng Tested-by: Stephen Warren --- fs/zfs/dev.c | 35 ++++++++++++++++------------------- fs/zfs/zfs.c | 2 +- 2 files changed, 17 insertions(+), 20 deletions(-) (limited to 'fs/zfs') diff --git a/fs/zfs/dev.c b/fs/zfs/dev.c index 67d1265..2f409e6 100644 --- a/fs/zfs/dev.c +++ b/fs/zfs/dev.c @@ -13,12 +13,12 @@ #include #include -static block_dev_desc_t *zfs_block_dev_desc; +static struct blk_desc *zfs_blk_desc; static disk_partition_t *part_info; -void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info) +void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info) { - zfs_block_dev_desc = rbdd; + zfs_blk_desc = rbdd; part_info = info; } @@ -48,17 +48,16 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf) debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len); - if (zfs_block_dev_desc == NULL) { + if (zfs_blk_desc == NULL) { printf("** Invalid Block Device Descriptor (NULL)\n"); return 1; } if (byte_offset != 0) { /* read first part which isn't aligned with start of sector */ - if (zfs_block_dev_desc->block_read(zfs_block_dev_desc, - part_info->start + sector, 1, - (void *)sec_buf) - != 1) { + if (zfs_blk_desc->block_read(zfs_blk_desc, + part_info->start + sector, 1, + (void *)sec_buf) != 1) { printf(" ** zfs_devread() read error **\n"); return 1; } @@ -79,18 +78,16 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf) u8 p[SECTOR_SIZE]; block_len = SECTOR_SIZE; - zfs_block_dev_desc->block_read(zfs_block_dev_desc, - part_info->start + sector, - 1, (void *)p); + zfs_blk_desc->block_read(zfs_blk_desc, + part_info->start + sector, + 1, (void *)p); memcpy(buf, p, byte_len); return 0; } - if (zfs_block_dev_desc->block_read(zfs_block_dev_desc, - part_info->start + sector, - block_len / SECTOR_SIZE, - (void *)buf) - != block_len / SECTOR_SIZE) { + if (zfs_blk_desc->block_read(zfs_blk_desc, part_info->start + sector, + block_len / SECTOR_SIZE, + (void *)buf) != block_len / SECTOR_SIZE) { printf(" ** zfs_devread() read error - block\n"); return 1; } @@ -102,9 +99,9 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf) if (byte_len != 0) { /* read rest of data which are not in whole sector */ - if (zfs_block_dev_desc->block_read(zfs_block_dev_desc, - part_info->start + sector, - 1, (void *)sec_buf) != 1) { + if (zfs_blk_desc->block_read(zfs_blk_desc, + part_info->start + sector, + 1, (void *)sec_buf) != 1) { printf(" ** zfs_devread() read error - last part\n"); return 1; } diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c index fb2b3ee..ca67afb 100644 --- a/fs/zfs/zfs.c +++ b/fs/zfs/zfs.c @@ -20,7 +20,7 @@ #include "zfs_common.h" #include "div64.h" -block_dev_desc_t *zfs_dev_desc; +struct blk_desc *zfs_dev_desc; /* * The zfs plug-in routines for GRUB are: -- cgit v1.1