diff options
author | Gao Xiang <gaoxiang25@huawei.com> | 2019-09-04 10:09:03 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-09-05 20:10:08 +0200 |
commit | e655b5b3a29c5a16056f13854ac3db5b39c0b804 (patch) | |
tree | 24f3d9243dd9acb179cb82a7cd627b2608f18153 /fs/erofs/data.c | |
parent | a5c0b7802cc9631e0dee67abd30c2f022621ae7c (diff) | |
download | linux-e655b5b3a29c5a16056f13854ac3db5b39c0b804.tar.bz2 |
erofs: kill prio and nofail of erofs_get_meta_page()
As Christoph pointed out [1],
"Why is there __erofs_get_meta_page with the two weird
booleans instead of a single erofs_get_meta_page that
gets and gfp_t for additional flags and an unsigned int
for additional bio op flags."
And since all callers can handle errors, let's kill
prio and nofail and erofs_get_inline_page() now.
[1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
Reported-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Gao Xiang <gaoxiang25@huawei.com>
Link: https://lore.kernel.org/r/20190904020912.63925-17-gaoxiang25@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/erofs/data.c')
-rw-r--r-- | fs/erofs/data.c | 25 |
1 files changed, 6 insertions, 19 deletions
diff --git a/fs/erofs/data.c b/fs/erofs/data.c index 0136ea117934..28eda71bb1a9 100644 --- a/fs/erofs/data.c +++ b/fs/erofs/data.c @@ -51,25 +51,19 @@ static struct bio *erofs_grab_raw_bio(struct super_block *sb, return bio; } -/* prio -- true is used for dir */ -struct page *__erofs_get_meta_page(struct super_block *sb, - erofs_blk_t blkaddr, bool prio, bool nofail) +struct page *erofs_get_meta_page(struct super_block *sb, erofs_blk_t blkaddr) { struct inode *const bd_inode = sb->s_bdev->bd_inode; struct address_space *const mapping = bd_inode->i_mapping; - /* prefer retrying in the allocator to blindly looping below */ - const gfp_t gfp = mapping_gfp_constraint(mapping, ~__GFP_FS) | - (nofail ? __GFP_NOFAIL : 0); - unsigned int io_retries = nofail ? EROFS_IO_MAX_RETRIES_NOFAIL : 0; + const gfp_t gfp = mapping_gfp_constraint(mapping, ~__GFP_FS); struct page *page; int err; repeat: page = find_or_create_page(mapping, blkaddr, gfp); - if (!page) { - DBG_BUGON(nofail); + if (!page) return ERR_PTR(-ENOMEM); - } + DBG_BUGON(!PageLocked(page)); if (!PageUptodate(page)) { @@ -82,14 +76,11 @@ repeat: goto err_out; } - __submit_bio(bio, REQ_OP_READ, - REQ_META | (prio ? REQ_PRIO : 0)); - + __submit_bio(bio, REQ_OP_READ, REQ_META); lock_page(page); /* this page has been truncated by others */ if (page->mapping != mapping) { -unlock_repeat: unlock_page(page); put_page(page); goto repeat; @@ -97,10 +88,6 @@ unlock_repeat: /* more likely a read error */ if (!PageUptodate(page)) { - if (io_retries) { - --io_retries; - goto unlock_repeat; - } err = -EIO; goto err_out; } @@ -251,7 +238,7 @@ submit_bio_retry: DBG_BUGON(map.m_plen > PAGE_SIZE); - ipage = erofs_get_meta_page(inode->i_sb, blknr, 0); + ipage = erofs_get_meta_page(inode->i_sb, blknr); if (IS_ERR(ipage)) { err = PTR_ERR(ipage); |