f2fs: remove the rw_flag domain from f2fs_io_info
When using the f2fs_io_info in the low level, we still need to merge the
rw and rw_flag, so use the rw to hold all the io flags directly,
and remove the rw_flag field.
ps.It is based on the previous patch:
f2fs: move all the bio initialization into __bio_alloc
Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 154a4f9..e46b5c5 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -105,7 +105,7 @@
if (!io->bio)
return;
- rw = fio->rw | fio->rw_flag;
+ rw = fio->rw;
if (is_read_io(rw)) {
trace_f2fs_submit_read_bio(io->sbi->sb, rw,
@@ -760,7 +760,6 @@
struct f2fs_io_info fio = {
.type = DATA,
.rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC: WRITE,
- .rw_flag = 0,
};
if (page->index < end_index)
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 8cbc5a6..42f28d4 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -368,9 +368,8 @@
};
struct f2fs_io_info {
- enum page_type type; /* contains DATA/NODE/META/META_FLUSH */
- int rw; /* contains R/RS/W/WS */
- int rw_flag; /* contains REQ_META/REQ_PRIO */
+ enum page_type type; /* contains DATA/NODE/META/META_FLUSH */
+ int rw; /* contains R/RS/W/WS with REQ_META/REQ_PRIO */
};
#define is_read_io(rw) (((rw) & 1) == READ)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index 69c18e3..599f546 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -523,7 +523,6 @@
struct f2fs_io_info fio = {
.type = DATA,
.rw = WRITE_SYNC,
- .rw_flag = 0,
};
if (gc_type == BG_GC) {
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index 3565caf..0af0a71 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -94,8 +94,7 @@
int i;
struct f2fs_io_info fio = {
.type = META,
- .rw = READ_SYNC,
- .rw_flag = REQ_META | REQ_PRIO
+ .rw = READ_SYNC | REQ_META | REQ_PRIO
};
@@ -1581,8 +1580,7 @@
int page_idx = start;
struct f2fs_io_info fio = {
.type = META,
- .rw = READ_SYNC,
- .rw_flag = REQ_META | REQ_PRIO
+ .rw = READ_SYNC | REQ_META | REQ_PRIO
};
for (; page_idx < start + nrpages; page_idx++) {
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 9f8bdd0..555ae76 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -916,8 +916,7 @@
{
struct f2fs_io_info fio = {
.type = META,
- .rw = WRITE_SYNC,
- .rw_flag = REQ_META | REQ_PRIO
+ .rw = WRITE_SYNC | REQ_META | REQ_PRIO
};
set_page_writeback(page);
@@ -931,7 +930,6 @@
struct f2fs_io_info fio = {
.type = NODE,
.rw = WRITE_SYNC,
- .rw_flag = 0
};
set_summary(&sum, nid, 0, 0);
@@ -1018,7 +1016,6 @@
struct f2fs_io_info fio = {
.type = NODE,
.rw = WRITE_SYNC,
- .rw_flag = 0
};
curseg = CURSEG_I(sbi, type);
@@ -1598,8 +1595,7 @@
int blkno = start;
struct f2fs_io_info fio = {
.type = META,
- .rw = READ_SYNC,
- .rw_flag = REQ_META | REQ_PRIO
+ .rw = READ_SYNC | REQ_META | REQ_PRIO
};
for (; blkno < start + nrpages && blkno < sit_blk_cnt; blkno++) {