mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-18 10:34:24 +08:00
hfsplus: use bio op accessors
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>
This commit is contained in:
parent
50bfcd0cbf
commit
67ed25961c
@ -526,7 +526,7 @@ int hfsplus_compare_dentry(const struct dentry *parent,
|
|||||||
|
|
||||||
/* wrapper.c */
|
/* wrapper.c */
|
||||||
int hfsplus_submit_bio(struct super_block *sb, sector_t sector, void *buf,
|
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);
|
int hfsplus_read_wrapper(struct super_block *sb);
|
||||||
|
|
||||||
/* time macros */
|
/* time macros */
|
||||||
|
@ -112,7 +112,8 @@ static int hfs_parse_new_pmap(struct super_block *sb, void *buf,
|
|||||||
if ((u8 *)pm - (u8 *)buf >= buf_size) {
|
if ((u8 *)pm - (u8 *)buf >= buf_size) {
|
||||||
res = hfsplus_submit_bio(sb,
|
res = hfsplus_submit_bio(sb,
|
||||||
*part_start + HFS_PMAP_BLK + i,
|
*part_start + HFS_PMAP_BLK + i,
|
||||||
buf, (void **)&pm, READ);
|
buf, (void **)&pm, REQ_OP_READ,
|
||||||
|
0);
|
||||||
if (res)
|
if (res)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
@ -136,7 +137,7 @@ int hfs_part_find(struct super_block *sb,
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
res = hfsplus_submit_bio(sb, *part_start + HFS_PMAP_BLK,
|
res = hfsplus_submit_bio(sb, *part_start + HFS_PMAP_BLK,
|
||||||
buf, &data, READ);
|
buf, &data, REQ_OP_READ, 0);
|
||||||
if (res)
|
if (res)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
@ -220,7 +220,8 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait)
|
|||||||
|
|
||||||
error2 = hfsplus_submit_bio(sb,
|
error2 = hfsplus_submit_bio(sb,
|
||||||
sbi->part_start + HFSPLUS_VOLHEAD_SECTOR,
|
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)
|
if (!error)
|
||||||
error = error2;
|
error = error2;
|
||||||
if (!write_backup)
|
if (!write_backup)
|
||||||
@ -228,7 +229,8 @@ static int hfsplus_sync_fs(struct super_block *sb, int wait)
|
|||||||
|
|
||||||
error2 = hfsplus_submit_bio(sb,
|
error2 = hfsplus_submit_bio(sb,
|
||||||
sbi->part_start + sbi->sect_count - 2,
|
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)
|
if (!error)
|
||||||
error2 = error;
|
error2 = error;
|
||||||
out:
|
out:
|
||||||
|
@ -30,7 +30,8 @@ struct hfsplus_wd {
|
|||||||
* @sector: block to read or write, for blocks of HFSPLUS_SECTOR_SIZE bytes
|
* @sector: block to read or write, for blocks of HFSPLUS_SECTOR_SIZE bytes
|
||||||
* @buf: buffer for I/O
|
* @buf: buffer for I/O
|
||||||
* @data: output pointer for location of requested data
|
* @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
|
* 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
|
* HFSPLUS_SECTOR_SIZE, and @buf must be sized accordingly. On reads
|
||||||
@ -44,7 +45,7 @@ struct hfsplus_wd {
|
|||||||
* will work correctly.
|
* will work correctly.
|
||||||
*/
|
*/
|
||||||
int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
|
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;
|
struct bio *bio;
|
||||||
int ret = 0;
|
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 = bio_alloc(GFP_NOIO, 1);
|
||||||
bio->bi_iter.bi_sector = sector;
|
bio->bi_iter.bi_sector = sector;
|
||||||
bio->bi_bdev = sb->s_bdev;
|
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;
|
*data = (u8 *)buf + offset;
|
||||||
|
|
||||||
while (io_size > 0) {
|
while (io_size > 0) {
|
||||||
@ -182,7 +183,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
|
|||||||
reread:
|
reread:
|
||||||
error = hfsplus_submit_bio(sb, part_start + HFSPLUS_VOLHEAD_SECTOR,
|
error = hfsplus_submit_bio(sb, part_start + HFSPLUS_VOLHEAD_SECTOR,
|
||||||
sbi->s_vhdr_buf, (void **)&sbi->s_vhdr,
|
sbi->s_vhdr_buf, (void **)&sbi->s_vhdr,
|
||||||
READ);
|
REQ_OP_READ, 0);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_free_backup_vhdr;
|
goto out_free_backup_vhdr;
|
||||||
|
|
||||||
@ -214,7 +215,8 @@ reread:
|
|||||||
|
|
||||||
error = hfsplus_submit_bio(sb, part_start + part_size - 2,
|
error = hfsplus_submit_bio(sb, part_start + part_size - 2,
|
||||||
sbi->s_backup_vhdr_buf,
|
sbi->s_backup_vhdr_buf,
|
||||||
(void **)&sbi->s_backup_vhdr, READ);
|
(void **)&sbi->s_backup_vhdr, REQ_OP_READ,
|
||||||
|
0);
|
||||||
if (error)
|
if (error)
|
||||||
goto out_free_backup_vhdr;
|
goto out_free_backup_vhdr;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user