aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-04-17 17:22:13 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-05-01 01:17:09 -0400
commitca52fec152282ef73e5e882b847b36b1febbb1c6 (patch)
tree8eb28f127a04b83af3abdfbf3d97c630e1668986
parent724c439c204b12a3537b71289fb4c0a42c3aa566 (diff)
NFS: Use pgoff_t in structures and functions that pass page cache offsets
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/pagelist.c4
-rw-r--r--fs/nfs/write.c18
-rw-r--r--include/linux/nfs_page.h4
3 files changed, 13 insertions, 13 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 096efd73eb4c..d846d39a31ef 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -383,12 +383,12 @@ void nfs_pageio_complete(struct nfs_pageio_descriptor *desc)
383 * You must be holding the inode's req_lock when calling this function 383 * You must be holding the inode's req_lock when calling this function
384 */ 384 */
385int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, 385int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head,
386 struct list_head *dst, unsigned long idx_start, 386 struct list_head *dst, pgoff_t idx_start,
387 unsigned int npages) 387 unsigned int npages)
388{ 388{
389 struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES]; 389 struct nfs_page *pgvec[NFS_SCAN_MAXENTRIES];
390 struct nfs_page *req; 390 struct nfs_page *req;
391 unsigned long idx_end; 391 pgoff_t idx_end;
392 int found, i; 392 int found, i;
393 int res; 393 int res;
394 394
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 424c4cea1208..5d44b8bd1070 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -139,7 +139,7 @@ static void nfs_grow_file(struct page *page, unsigned int offset, unsigned int c
139{ 139{
140 struct inode *inode = page->mapping->host; 140 struct inode *inode = page->mapping->host;
141 loff_t end, i_size = i_size_read(inode); 141 loff_t end, i_size = i_size_read(inode);
142 unsigned long end_index = (i_size - 1) >> PAGE_CACHE_SHIFT; 142 pgoff_t end_index = (i_size - 1) >> PAGE_CACHE_SHIFT;
143 143
144 if (i_size > 0 && page->index < end_index) 144 if (i_size > 0 && page->index < end_index)
145 return; 145 return;
@@ -511,11 +511,11 @@ int nfs_reschedule_unstable_write(struct nfs_page *req)
511 * 511 *
512 * Interruptible by signals only if mounted with intr flag. 512 * Interruptible by signals only if mounted with intr flag.
513 */ 513 */
514static int nfs_wait_on_requests_locked(struct inode *inode, unsigned long idx_start, unsigned int npages) 514static int nfs_wait_on_requests_locked(struct inode *inode, pgoff_t idx_start, unsigned int npages)
515{ 515{
516 struct nfs_inode *nfsi = NFS_I(inode); 516 struct nfs_inode *nfsi = NFS_I(inode);
517 struct nfs_page *req; 517 struct nfs_page *req;
518 unsigned long idx_end, next; 518 pgoff_t idx_end, next;
519 unsigned int res = 0; 519 unsigned int res = 0;
520 int error; 520 int error;
521 521
@@ -570,7 +570,7 @@ static void nfs_cancel_commit_list(struct list_head *head)
570 * The requests are *not* checked to ensure that they form a contiguous set. 570 * The requests are *not* checked to ensure that they form a contiguous set.
571 */ 571 */
572static int 572static int
573nfs_scan_commit(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages) 573nfs_scan_commit(struct inode *inode, struct list_head *dst, pgoff_t idx_start, unsigned int npages)
574{ 574{
575 struct nfs_inode *nfsi = NFS_I(inode); 575 struct nfs_inode *nfsi = NFS_I(inode);
576 int res = 0; 576 int res = 0;
@@ -584,7 +584,7 @@ nfs_scan_commit(struct inode *inode, struct list_head *dst, unsigned long idx_st
584 return res; 584 return res;
585} 585}
586#else 586#else
587static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst, unsigned long idx_start, unsigned int npages) 587static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst, pgoff_t idx_start, unsigned int npages)
588{ 588{
589 return 0; 589 return 0;
590} 590}
@@ -604,7 +604,7 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
604 struct inode *inode = mapping->host; 604 struct inode *inode = mapping->host;
605 struct nfs_inode *nfsi = NFS_I(inode); 605 struct nfs_inode *nfsi = NFS_I(inode);
606 struct nfs_page *req, *new = NULL; 606 struct nfs_page *req, *new = NULL;
607 unsigned long rqend, end; 607 pgoff_t rqend, end;
608 608
609 end = offset + bytes; 609 end = offset + bytes;
610 610
@@ -1292,7 +1292,7 @@ long nfs_sync_mapping_wait(struct address_space *mapping, struct writeback_contr
1292{ 1292{
1293 struct inode *inode = mapping->host; 1293 struct inode *inode = mapping->host;
1294 struct nfs_inode *nfsi = NFS_I(inode); 1294 struct nfs_inode *nfsi = NFS_I(inode);
1295 unsigned long idx_start, idx_end; 1295 pgoff_t idx_start, idx_end;
1296 unsigned int npages = 0; 1296 unsigned int npages = 0;
1297 LIST_HEAD(head); 1297 LIST_HEAD(head);
1298 int nocommit = how & FLUSH_NOCOMMIT; 1298 int nocommit = how & FLUSH_NOCOMMIT;
@@ -1305,10 +1305,10 @@ long nfs_sync_mapping_wait(struct address_space *mapping, struct writeback_contr
1305 idx_start = wbc->range_start >> PAGE_CACHE_SHIFT; 1305 idx_start = wbc->range_start >> PAGE_CACHE_SHIFT;
1306 idx_end = wbc->range_end >> PAGE_CACHE_SHIFT; 1306 idx_end = wbc->range_end >> PAGE_CACHE_SHIFT;
1307 if (idx_end > idx_start) { 1307 if (idx_end > idx_start) {
1308 unsigned long l_npages = 1 + idx_end - idx_start; 1308 pgoff_t l_npages = 1 + idx_end - idx_start;
1309 npages = l_npages; 1309 npages = l_npages;
1310 if (sizeof(npages) != sizeof(l_npages) && 1310 if (sizeof(npages) != sizeof(l_npages) &&
1311 (unsigned long)npages != l_npages) 1311 (pgoff_t)npages != l_npages)
1312 npages = 0; 1312 npages = 0;
1313 } 1313 }
1314 } 1314 }
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 8e9e7bceda48..41afab6b5f09 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -38,7 +38,7 @@ struct nfs_page {
38 struct page *wb_page; /* page to read in/write out */ 38 struct page *wb_page; /* page to read in/write out */
39 struct nfs_open_context *wb_context; /* File state context info */ 39 struct nfs_open_context *wb_context; /* File state context info */
40 atomic_t wb_complete; /* i/os we're waiting for */ 40 atomic_t wb_complete; /* i/os we're waiting for */
41 unsigned long wb_index; /* Offset >> PAGE_CACHE_SHIFT */ 41 pgoff_t wb_index; /* Offset >> PAGE_CACHE_SHIFT */
42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ 42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
43 wb_pgbase, /* Start of page data */ 43 wb_pgbase, /* Start of page data */
44 wb_bytes; /* Length of request */ 44 wb_bytes; /* Length of request */
@@ -72,7 +72,7 @@ extern void nfs_release_request(struct nfs_page *req);
72 72
73 73
74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, 74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst,
75 unsigned long idx_start, unsigned int npages); 75 pgoff_t idx_start, unsigned int npages);
76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
77 struct inode *inode, 77 struct inode *inode,
78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), 78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int),