hfsplus: use bio op accessors
authorMike Christie <mchristi@redhat.com>
Sun, 5 Jun 2016 19:31:58 +0000 (14:31 -0500)
committerJens Axboe <axboe@fb.com>
Tue, 7 Jun 2016 19:41:38 +0000 (13:41 -0600)
Separate the op from the rq_flag_bits and have gfs2
set/get the bio using bio_set_op_attrs/bio_op.

Signed-off-by: Mike Christie <mchristi@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
fs/hfsplus/hfsplus_fs.h
fs/hfsplus/part_tbl.c
fs/hfsplus/super.c
fs/hfsplus/wrapper.c

index fdc3446d934ad17523a6fba3490343e85756702a..047245bd2cd64550bc00cf827473456507b53a08 100644 (file)
@@ -526,7 +526,7 @@ int hfsplus_compare_dentry(const struct dentry *parent,
 
 /* wrapper.c */
 int hfsplus_submit_bio(struct super_block *sb, sector_t sector, void *buf,
-                      void **data, int rw);
+                      void **data, int op, int op_flags);
 int hfsplus_read_wrapper(struct super_block *sb);
 
 /* time macros */
index eb355d81e2798343720051c19e9d5559142a68e1..63164ebc52fa14f56570984908e409d5d0a4ba69 100644 (file)
@@ -112,7 +112,8 @@ static int hfs_parse_new_pmap(struct super_block *sb, void *buf,
                if ((u8 *)pm - (u8 *)buf >= buf_size) {
                        res = hfsplus_submit_bio(sb,
                                                 *part_start + HFS_PMAP_BLK + i,
-                                                buf, (void **)&pm, READ);
+                                                buf, (void **)&pm, REQ_OP_READ,
+                                                0);
                        if (res)
                                return res;
                }
@@ -136,7 +137,7 @@ int hfs_part_find(struct super_block *sb,
                return -ENOMEM;
 
        res = hfsplus_submit_bio(sb, *part_start + HFS_PMAP_BLK,
-                                buf, &data, READ);
+                                buf, &data, REQ_OP_READ, 0);
        if (res)
                goto out;
 
index 755bf30ba1ce5971df4c7693a0afbb2600cd2b00..11854dd84572639e86fc70290be9ff2ee4bd725a 100644 (file)
@@ -220,7 +220,8 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait)
 
        error2 = hfsplus_submit_bio(sb,
                                   sbi->part_start + HFSPLUS_VOLHEAD_SECTOR,
-                                  sbi->s_vhdr_buf, NULL, WRITE_SYNC);
+                                  sbi->s_vhdr_buf, NULL, REQ_OP_WRITE,
+                                  WRITE_SYNC);
        if (!error)
                error = error2;
        if (!write_backup)
@@ -228,7 +229,8 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait)
 
        error2 = hfsplus_submit_bio(sb,
                                  sbi->part_start + sbi->sect_count - 2,
-                                 sbi->s_backup_vhdr_buf, NULL, WRITE_SYNC);
+                                 sbi->s_backup_vhdr_buf, NULL, REQ_OP_WRITE,
+                                 WRITE_SYNC);
        if (!error)
                error2 = error;
 out:
index d026bb3fb36f3efc20b83ab7fdbf3748c7ffbdd6..ebb85e5f65499f3098fdecdc76333b40d7ad3d6b 100644 (file)
@@ -30,7 +30,8 @@ struct hfsplus_wd {
  * @sector: block to read or write, for blocks of HFSPLUS_SECTOR_SIZE bytes
  * @buf: buffer for I/O
  * @data: output pointer for location of requested data
- * @rw: direction of I/O
+ * @op: direction of I/O
+ * @op_flags: request op flags
  *
  * The unit of I/O is hfsplus_min_io_size(sb), which may be bigger than
  * HFSPLUS_SECTOR_SIZE, and @buf must be sized accordingly. On reads
@@ -44,7 +45,7 @@ struct hfsplus_wd {
  * will work correctly.
  */
 int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
-               void *buf, void **data, int rw)
+                      void *buf, void **data, int op, int op_flags)
 {
        struct bio *bio;
        int ret = 0;
@@ -65,9 +66,9 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
        bio = bio_alloc(GFP_NOIO, 1);
        bio->bi_iter.bi_sector = sector;
        bio->bi_bdev = sb->s_bdev;
-       bio->bi_rw = rw;
+       bio_set_op_attrs(bio, op, op_flags);
 
-       if (!(rw & WRITE) && data)
+       if (op != WRITE && data)
                *data = (u8 *)buf + offset;
 
        while (io_size > 0) {
@@ -182,7 +183,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
 reread:
        error = hfsplus_submit_bio(sb, part_start + HFSPLUS_VOLHEAD_SECTOR,
                                   sbi->s_vhdr_buf, (void **)&sbi->s_vhdr,
-                                  READ);
+                                  REQ_OP_READ, 0);
        if (error)
                goto out_free_backup_vhdr;
 
@@ -214,7 +215,8 @@ reread:
 
        error = hfsplus_submit_bio(sb, part_start + part_size - 2,
                                   sbi->s_backup_vhdr_buf,
-                                  (void **)&sbi->s_backup_vhdr, READ);
+                                  (void **)&sbi->s_backup_vhdr, REQ_OP_READ,
+                                  0);
        if (error)
                goto out_free_backup_vhdr;