ext4: After completely filled group, scan next group from the beginning
[oweals/u-boot.git] / fs / zfs / dev.c
index 3a1fa5685afe0540b9e111971c4285d12389cda1..2f409e66cddf0f6f5748144a962c1fd335c9f154 100644 (file)
 #include <config.h>
 #include <zfs_common.h>
 
-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,16 +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->dev,
-                       part_info->start + sector, 1,
-                       (unsigned long *)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;
                }
@@ -78,16 +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->dev,
-                       part_info->start + sector,
-                       1, (unsigned long *)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->dev,
-               part_info->start + sector, block_len / SECTOR_SIZE,
-               (unsigned long *) 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;
        }
@@ -99,10 +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->dev,
-                                          part_info->start + sector, 1,
-                                          (unsigned long *) 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;
                }