aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4filelayout.c6
-rw-r--r--fs/nfs/objlayout/objio_osd.c7
-rw-r--r--fs/nfs/pagelist.c22
-rw-r--r--fs/nfs/pnfs.c4
-rw-r--r--fs/nfs/pnfs.h4
5 files changed, 21 insertions, 22 deletions
diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 33bda24e8cd2..24f05720daf1 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -651,10 +651,10 @@ filelayout_alloc_lseg(struct pnfs_layout_hdr *layoutid,
651/* 651/*
652 * filelayout_pg_test(). Called by nfs_can_coalesce_requests() 652 * filelayout_pg_test(). Called by nfs_can_coalesce_requests()
653 * 653 *
654 * return 1 : coalesce page 654 * return true : coalesce page
655 * return 0 : don't coalesce page 655 * return false : don't coalesce page
656 */ 656 */
657int 657bool
658filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, 658filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
659 struct nfs_page *req) 659 struct nfs_page *req)
660{ 660{
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index 3be124160e97..8c2bd3eb8e8d 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -991,14 +991,13 @@ ssize_t objio_write_pagelist(struct objlayout_io_state *ol_state, bool stable)
991/* 991/*
992 * objlayout_pg_test(). Called by nfs_can_coalesce_requests() 992 * objlayout_pg_test(). Called by nfs_can_coalesce_requests()
993 * 993 *
994 * return 1 : coalesce page 994 * return true iff coalesce page
995 * return 0 : don't coalesce page
996 */ 995 */
997int 996bool
998objlayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, 997objlayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
999 struct nfs_page *req) 998 struct nfs_page *req)
1000{ 999{
1001 return 1; 1000 return true;
1002} 1001}
1003 1002
1004static struct pnfs_layoutdriver_type objlayout_type = { 1003static struct pnfs_layoutdriver_type objlayout_type = {
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index b8704fedcd16..5344371a257c 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -244,29 +244,29 @@ void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
244 * 244 *
245 * Return 'true' if this is the case, else return 'false'. 245 * Return 'true' if this is the case, else return 'false'.
246 */ 246 */
247static int nfs_can_coalesce_requests(struct nfs_page *prev, 247static bool nfs_can_coalesce_requests(struct nfs_page *prev,
248 struct nfs_page *req, 248 struct nfs_page *req,
249 struct nfs_pageio_descriptor *pgio) 249 struct nfs_pageio_descriptor *pgio)
250{ 250{
251 if (req->wb_context->cred != prev->wb_context->cred) 251 if (req->wb_context->cred != prev->wb_context->cred)
252 return 0; 252 return false;
253 if (req->wb_lock_context->lockowner != prev->wb_lock_context->lockowner) 253 if (req->wb_lock_context->lockowner != prev->wb_lock_context->lockowner)
254 return 0; 254 return false;
255 if (req->wb_context->state != prev->wb_context->state) 255 if (req->wb_context->state != prev->wb_context->state)
256 return 0; 256 return false;
257 if (req->wb_index != (prev->wb_index + 1)) 257 if (req->wb_index != (prev->wb_index + 1))
258 return 0; 258 return false;
259 if (req->wb_pgbase != 0) 259 if (req->wb_pgbase != 0)
260 return 0; 260 return false;
261 if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE) 261 if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE)
262 return 0; 262 return false;
263 /* 263 /*
264 * Non-whole file layouts need to check that req is inside of 264 * Non-whole file layouts need to check that req is inside of
265 * pgio->pg_lseg. 265 * pgio->pg_lseg.
266 */ 266 */
267 if (pgio->pg_test && !pgio->pg_test(pgio, prev, req)) 267 if (pgio->pg_test && !pgio->pg_test(pgio, prev, req))
268 return 0; 268 return false;
269 return 1; 269 return true;
270} 270}
271 271
272/** 272/**
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index 568ab0eef677..212fc292761a 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1043,7 +1043,7 @@ out_forget_reply:
1043 goto out; 1043 goto out;
1044} 1044}
1045 1045
1046int 1046bool
1047pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, 1047pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
1048 struct nfs_page *req) 1048 struct nfs_page *req)
1049{ 1049{
@@ -1070,7 +1070,7 @@ pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev,
1070 } else if (pgio->pg_lseg && 1070 } else if (pgio->pg_lseg &&
1071 req_offset(req) > end_offset(pgio->pg_lseg->pls_range.offset, 1071 req_offset(req) > end_offset(pgio->pg_lseg->pls_range.offset,
1072 pgio->pg_lseg->pls_range.length)) 1072 pgio->pg_lseg->pls_range.length))
1073 return 0; 1073 return false;
1074 return NFS_SERVER(pgio->pg_inode)->pnfs_curr_ld->pg_test(pgio, prev, req); 1074 return NFS_SERVER(pgio->pg_inode)->pnfs_curr_ld->pg_test(pgio, prev, req);
1075} 1075}
1076 1076
diff --git a/fs/nfs/pnfs.h b/fs/nfs/pnfs.h
index c056688ee92b..65daae59c8ae 100644
--- a/fs/nfs/pnfs.h
+++ b/fs/nfs/pnfs.h
@@ -87,7 +87,7 @@ struct pnfs_layoutdriver_type {
87 void (*free_lseg) (struct pnfs_layout_segment *lseg); 87 void (*free_lseg) (struct pnfs_layout_segment *lseg);
88 88
89 /* test for nfs page cache coalescing */ 89 /* test for nfs page cache coalescing */
90 int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *); 90 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
91 91
92 /* Returns true if layoutdriver wants to divert this request to 92 /* Returns true if layoutdriver wants to divert this request to
93 * driver's commit routine. 93 * driver's commit routine.
@@ -158,7 +158,7 @@ enum pnfs_try_status pnfs_try_to_write_data(struct nfs_write_data *,
158 const struct rpc_call_ops *, int); 158 const struct rpc_call_ops *, int);
159enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *, 159enum pnfs_try_status pnfs_try_to_read_data(struct nfs_read_data *,
160 const struct rpc_call_ops *); 160 const struct rpc_call_ops *);
161int pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, struct nfs_page *req); 161bool pnfs_generic_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, struct nfs_page *req);
162int pnfs_layout_process(struct nfs4_layoutget *lgp); 162int pnfs_layout_process(struct nfs4_layoutget *lgp);
163void pnfs_free_lseg_list(struct list_head *tmp_list); 163void pnfs_free_lseg_list(struct list_head *tmp_list);
164void pnfs_destroy_layout(struct nfs_inode *); 164void pnfs_destroy_layout(struct nfs_inode *);