Commit eef2c071 authored by Eric Sandeen's avatar Eric Sandeen Committed by Christoph Hellwig

[XFS] Use pgoff_t for page indices, and remove other type confusion

SGI Modid: xfs-linux:xfs-kern:168484a
parent c54e4da3
...@@ -265,7 +265,7 @@ xfs_map_at_offset( ...@@ -265,7 +265,7 @@ xfs_map_at_offset(
STATIC struct page * STATIC struct page *
xfs_probe_unwritten_page( xfs_probe_unwritten_page(
struct address_space *mapping, struct address_space *mapping,
unsigned long index, pgoff_t index,
xfs_iomap_t *iomapp, xfs_iomap_t *iomapp,
xfs_buf_t *pb, xfs_buf_t *pb,
unsigned long max_offset, unsigned long max_offset,
...@@ -316,7 +316,7 @@ xfs_probe_unwritten_page( ...@@ -316,7 +316,7 @@ xfs_probe_unwritten_page(
STATIC unsigned int STATIC unsigned int
xfs_probe_unmapped_page( xfs_probe_unmapped_page(
struct address_space *mapping, struct address_space *mapping,
unsigned long index, pgoff_t index,
unsigned int pg_offset) unsigned int pg_offset)
{ {
struct page *page; struct page *page;
...@@ -356,8 +356,8 @@ xfs_probe_unmapped_cluster( ...@@ -356,8 +356,8 @@ xfs_probe_unmapped_cluster(
struct buffer_head *bh, struct buffer_head *bh,
struct buffer_head *head) struct buffer_head *head)
{ {
unsigned long tindex, tlast, tloff; pgoff_t tindex, tlast, tloff;
unsigned int len, total = 0; unsigned int pg_offset, len, total = 0;
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
/* First sum forwards in this page */ /* First sum forwards in this page */
...@@ -382,9 +382,9 @@ xfs_probe_unmapped_cluster( ...@@ -382,9 +382,9 @@ xfs_probe_unmapped_cluster(
total += len; total += len;
} }
if (tindex == tlast && if (tindex == tlast &&
(tloff = i_size_read(inode) & (PAGE_CACHE_SIZE - 1))) { (pg_offset = i_size_read(inode) & (PAGE_CACHE_SIZE - 1))) {
total += xfs_probe_unmapped_page(mapping, total += xfs_probe_unmapped_page(mapping,
tindex, tloff); tindex, pg_offset);
} }
} }
return total; return total;
...@@ -398,7 +398,7 @@ xfs_probe_unmapped_cluster( ...@@ -398,7 +398,7 @@ xfs_probe_unmapped_cluster(
STATIC struct page * STATIC struct page *
xfs_probe_delalloc_page( xfs_probe_delalloc_page(
struct inode *inode, struct inode *inode,
unsigned long index) pgoff_t index)
{ {
struct page *page; struct page *page;
...@@ -497,8 +497,9 @@ xfs_map_unwritten( ...@@ -497,8 +497,9 @@ xfs_map_unwritten(
*/ */
if (bh == head) { if (bh == head) {
struct address_space *mapping = inode->i_mapping; struct address_space *mapping = inode->i_mapping;
unsigned long tindex, tloff, tlast, bs; pgoff_t tindex, tloff, tlast;
unsigned int bbits = inode->i_blkbits; unsigned long bs;
unsigned int pg_offset, bbits = inode->i_blkbits;
struct page *page; struct page *page;
tlast = i_size_read(inode) >> PAGE_CACHE_SHIFT; tlast = i_size_read(inode) >> PAGE_CACHE_SHIFT;
...@@ -522,10 +523,10 @@ xfs_map_unwritten( ...@@ -522,10 +523,10 @@ xfs_map_unwritten(
} }
if (tindex == tlast && if (tindex == tlast &&
(tloff = (i_size_read(inode) & (PAGE_CACHE_SIZE - 1)))) { (pg_offset = (i_size_read(inode) & (PAGE_CACHE_SIZE - 1)))) {
page = xfs_probe_unwritten_page(mapping, page = xfs_probe_unwritten_page(mapping,
tindex, iomapp, pb, tindex, iomapp, pb,
tloff, &bs, bbits); pg_offset, &bs, bbits);
if (page) { if (page) {
nblocks += bs; nblocks += bs;
atomic_add(bs, &pb->pb_io_remaining); atomic_add(bs, &pb->pb_io_remaining);
...@@ -603,7 +604,8 @@ xfs_convert_page( ...@@ -603,7 +604,8 @@ xfs_convert_page(
{ {
struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head; struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head;
xfs_iomap_t *mp = iomapp, *tmp; xfs_iomap_t *mp = iomapp, *tmp;
unsigned long end, offset, end_index; unsigned long end, offset;
pgoff_t end_index;
int i = 0, index = 0; int i = 0, index = 0;
int bbits = inode->i_blkbits; int bbits = inode->i_blkbits;
...@@ -671,12 +673,12 @@ xfs_convert_page( ...@@ -671,12 +673,12 @@ xfs_convert_page(
STATIC void STATIC void
xfs_cluster_write( xfs_cluster_write(
struct inode *inode, struct inode *inode,
unsigned long tindex, pgoff_t tindex,
xfs_iomap_t *iomapp, xfs_iomap_t *iomapp,
int startio, int startio,
int all_bh) int all_bh)
{ {
unsigned long tlast; pgoff_t tlast;
struct page *page; struct page *page;
tlast = (iomapp->iomap_offset + iomapp->iomap_bsize) >> PAGE_CACHE_SHIFT; tlast = (iomapp->iomap_offset + iomapp->iomap_bsize) >> PAGE_CACHE_SHIFT;
...@@ -716,9 +718,9 @@ xfs_page_state_convert( ...@@ -716,9 +718,9 @@ xfs_page_state_convert(
{ {
struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head; struct buffer_head *bh_arr[MAX_BUF_PER_PAGE], *bh, *head;
xfs_iomap_t *iomp, iomap; xfs_iomap_t *iomp, iomap;
unsigned long p_offset = 0, end_index; pgoff_t end_index;
unsigned long end_index;
loff_t offset; loff_t offset;
unsigned long long end_offset;
int len, err, i, cnt = 0, uptodate = 1; int len, err, i, cnt = 0, uptodate = 1;
int flags = startio ? 0 : BMAPI_TRYLOCK; int flags = startio ? 0 : BMAPI_TRYLOCK;
int page_dirty = 1; int page_dirty = 1;
......
...@@ -368,7 +368,7 @@ _pagebuf_lookup_pages( ...@@ -368,7 +368,7 @@ _pagebuf_lookup_pages(
size_t size = bp->pb_count_desired, nbytes; size_t size = bp->pb_count_desired, nbytes;
size_t offset = bp->pb_offset; size_t offset = bp->pb_offset;
int gfp_mask = pb_to_gfp(flags); int gfp_mask = pb_to_gfp(flags);
unsigned long page_count, i; unsigned short page_count, i;
pgoff_t first; pgoff_t first;
loff_t end; loff_t end;
int error; int error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment