提交 fba73005 编写于 作者: T Trond Myklebust

NFS: Don't rely on PageError in nfs_readpage_release_partial

Don't rely on the PageError flag to tell us if one of the partial reads of
the page failed. Instead, replace that with a dedicated flag in the
struct nfs_page.

Then clean out redundant uses of the PageError flag: the VM no longer
checks it for reads.
Signed-off-by: NTrond Myklebust <Trond.Myklebust@netapp.com>
上级 fbb5a9ab
...@@ -276,7 +276,6 @@ nfs_async_read_error(struct list_head *head) ...@@ -276,7 +276,6 @@ nfs_async_read_error(struct list_head *head)
while (!list_empty(head)) { while (!list_empty(head)) {
req = nfs_list_entry(head->next); req = nfs_list_entry(head->next);
nfs_list_remove_request(req); nfs_list_remove_request(req);
SetPageError(req->wb_page);
nfs_readpage_release(req); nfs_readpage_release(req);
} }
} }
...@@ -330,7 +329,6 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, struct list_head ...@@ -330,7 +329,6 @@ static int nfs_pagein_multi(struct nfs_pageio_descriptor *desc, struct list_head
list_del(&data->list); list_del(&data->list);
nfs_readdata_free(data); nfs_readdata_free(data);
} }
SetPageError(page);
nfs_readpage_release(req); nfs_readpage_release(req);
return -ENOMEM; return -ENOMEM;
} }
...@@ -460,10 +458,10 @@ static void nfs_readpage_release_partial(void *calldata) ...@@ -460,10 +458,10 @@ static void nfs_readpage_release_partial(void *calldata)
int status = data->task.tk_status; int status = data->task.tk_status;
if (status < 0) if (status < 0)
SetPageError(page); set_bit(PG_PARTIAL_READ_FAILED, &req->wb_flags);
if (atomic_dec_and_test(&req->wb_complete)) { if (atomic_dec_and_test(&req->wb_complete)) {
if (!PageError(page)) if (!test_bit(PG_PARTIAL_READ_FAILED, &req->wb_flags))
SetPageUptodate(page); SetPageUptodate(page);
nfs_readpage_release(req); nfs_readpage_release(req);
} }
...@@ -656,7 +654,6 @@ readpage_async_filler(void *data, struct page *page) ...@@ -656,7 +654,6 @@ readpage_async_filler(void *data, struct page *page)
return 0; return 0;
out_error: out_error:
error = PTR_ERR(new); error = PTR_ERR(new);
SetPageError(page);
out_unlock: out_unlock:
unlock_page(page); unlock_page(page);
return error; return error;
......
...@@ -34,6 +34,7 @@ enum { ...@@ -34,6 +34,7 @@ enum {
PG_NEED_COMMIT, PG_NEED_COMMIT,
PG_NEED_RESCHED, PG_NEED_RESCHED,
PG_PNFS_COMMIT, PG_PNFS_COMMIT,
PG_PARTIAL_READ_FAILED,
}; };
struct nfs_inode; struct nfs_inode;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册