Commit 967c9ec4 authored by Dave Kleikamp's avatar Dave Kleikamp

JFS: simplify types to get rid of sparse warning

jfs_metapage.c was using uints and unsigned ints inconsistently when
regular ints suffice.
Signed-off-by: default avatarDave Kleikamp <shaggy@linux.vnet.ibm.com>
parent da8a41d1
...@@ -88,7 +88,7 @@ struct meta_anchor { ...@@ -88,7 +88,7 @@ struct meta_anchor {
}; };
#define mp_anchor(page) ((struct meta_anchor *)page_private(page)) #define mp_anchor(page) ((struct meta_anchor *)page_private(page))
static inline struct metapage *page_to_mp(struct page *page, uint offset) static inline struct metapage *page_to_mp(struct page *page, int offset)
{ {
if (!PagePrivate(page)) if (!PagePrivate(page))
return NULL; return NULL;
...@@ -153,7 +153,7 @@ static inline void dec_io(struct page *page, void (*handler) (struct page *)) ...@@ -153,7 +153,7 @@ static inline void dec_io(struct page *page, void (*handler) (struct page *))
} }
#else #else
static inline struct metapage *page_to_mp(struct page *page, uint offset) static inline struct metapage *page_to_mp(struct page *page, int offset)
{ {
return PagePrivate(page) ? (struct metapage *)page_private(page) : NULL; return PagePrivate(page) ? (struct metapage *)page_private(page) : NULL;
} }
...@@ -249,7 +249,7 @@ static inline void drop_metapage(struct page *page, struct metapage *mp) ...@@ -249,7 +249,7 @@ static inline void drop_metapage(struct page *page, struct metapage *mp)
*/ */
static sector_t metapage_get_blocks(struct inode *inode, sector_t lblock, static sector_t metapage_get_blocks(struct inode *inode, sector_t lblock,
unsigned int *len) int *len)
{ {
int rc = 0; int rc = 0;
int xflag; int xflag;
...@@ -352,11 +352,11 @@ static void metapage_write_end_io(struct bio *bio, int err) ...@@ -352,11 +352,11 @@ static void metapage_write_end_io(struct bio *bio, int err)
static int metapage_writepage(struct page *page, struct writeback_control *wbc) static int metapage_writepage(struct page *page, struct writeback_control *wbc)
{ {
struct bio *bio = NULL; struct bio *bio = NULL;
unsigned int block_offset; /* block offset of mp within page */ int block_offset; /* block offset of mp within page */
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
unsigned int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage; int blocks_per_mp = JFS_SBI(inode->i_sb)->nbperpage;
unsigned int len; int len;
unsigned int xlen; int xlen;
struct metapage *mp; struct metapage *mp;
int redirty = 0; int redirty = 0;
sector_t lblock; sector_t lblock;
...@@ -366,7 +366,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) ...@@ -366,7 +366,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
sector_t page_start; sector_t page_start;
unsigned long bio_bytes = 0; unsigned long bio_bytes = 0;
unsigned long bio_offset = 0; unsigned long bio_offset = 0;
unsigned int offset; int offset;
page_start = (sector_t)page->index << page_start = (sector_t)page->index <<
(PAGE_CACHE_SHIFT - inode->i_blkbits); (PAGE_CACHE_SHIFT - inode->i_blkbits);
...@@ -428,7 +428,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc) ...@@ -428,7 +428,7 @@ static int metapage_writepage(struct page *page, struct writeback_control *wbc)
continue; continue;
} }
set_bit(META_io, &mp->flag); set_bit(META_io, &mp->flag);
len = min(xlen, (uint) JFS_SBI(inode->i_sb)->nbperpage); len = min(xlen, (int)JFS_SBI(inode->i_sb)->nbperpage);
bio = bio_alloc(GFP_NOFS, 1); bio = bio_alloc(GFP_NOFS, 1);
bio->bi_bdev = inode->i_sb->s_bdev; bio->bi_bdev = inode->i_sb->s_bdev;
...@@ -480,13 +480,13 @@ static int metapage_readpage(struct file *fp, struct page *page) ...@@ -480,13 +480,13 @@ static int metapage_readpage(struct file *fp, struct page *page)
{ {
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct bio *bio = NULL; struct bio *bio = NULL;
unsigned int block_offset; int block_offset;
unsigned int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits; int blocks_per_page = PAGE_CACHE_SIZE >> inode->i_blkbits;
sector_t page_start; /* address of page in fs blocks */ sector_t page_start; /* address of page in fs blocks */
sector_t pblock; sector_t pblock;
unsigned int xlen; int xlen;
unsigned int len; unsigned int len;
unsigned int offset; int offset;
BUG_ON(!PageLocked(page)); BUG_ON(!PageLocked(page));
page_start = (sector_t)page->index << page_start = (sector_t)page->index <<
...@@ -535,7 +535,7 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask) ...@@ -535,7 +535,7 @@ static int metapage_releasepage(struct page *page, gfp_t gfp_mask)
{ {
struct metapage *mp; struct metapage *mp;
int ret = 1; int ret = 1;
unsigned int offset; int offset;
for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) { for (offset = 0; offset < PAGE_CACHE_SIZE; offset += PSIZE) {
mp = page_to_mp(page, offset); mp = page_to_mp(page, offset);
......
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