Commit d67c0fd5 authored by Andrew Morton's avatar Andrew Morton Committed by Jaroslav Kysela

[PATCH] CONFIG_LBD fixes

From: Eric Sandeen <sandeen@sgi.com>

Several functions in buffer.c are using unsigned long where they should be
using sector_t.

Also, use pgoff_t in several places so it is easier to tell what is beingused
as a pagecache index, what is being used as a disk index and what is being
used as an offset-into-page.
parent 1cd4dae0
...@@ -404,7 +404,7 @@ __find_get_block_slow(struct block_device *bdev, sector_t block, int unused) ...@@ -404,7 +404,7 @@ __find_get_block_slow(struct block_device *bdev, sector_t block, int unused)
struct inode *bd_inode = bdev->bd_inode; struct inode *bd_inode = bdev->bd_inode;
struct address_space *bd_mapping = bd_inode->i_mapping; struct address_space *bd_mapping = bd_inode->i_mapping;
struct buffer_head *ret = NULL; struct buffer_head *ret = NULL;
unsigned long index; pgoff_t index;
struct buffer_head *bh; struct buffer_head *bh;
struct buffer_head *head; struct buffer_head *head;
struct page *page; struct page *page;
...@@ -1093,7 +1093,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head) ...@@ -1093,7 +1093,7 @@ link_dev_buffers(struct page *page, struct buffer_head *head)
*/ */
static void static void
init_page_buffers(struct page *page, struct block_device *bdev, init_page_buffers(struct page *page, struct block_device *bdev,
int block, int size) sector_t block, int size)
{ {
struct buffer_head *head = page_buffers(page); struct buffer_head *head = page_buffers(page);
struct buffer_head *bh = head; struct buffer_head *bh = head;
...@@ -1121,8 +1121,8 @@ init_page_buffers(struct page *page, struct block_device *bdev, ...@@ -1121,8 +1121,8 @@ init_page_buffers(struct page *page, struct block_device *bdev,
* This is user purely for blockdev mappings. * This is user purely for blockdev mappings.
*/ */
static struct page * static struct page *
grow_dev_page(struct block_device *bdev, unsigned long block, grow_dev_page(struct block_device *bdev, sector_t block,
unsigned long index, int size) pgoff_t index, int size)
{ {
struct inode *inode = bdev->bd_inode; struct inode *inode = bdev->bd_inode;
struct page *page; struct page *page;
...@@ -1178,10 +1178,10 @@ grow_dev_page(struct block_device *bdev, unsigned long block, ...@@ -1178,10 +1178,10 @@ grow_dev_page(struct block_device *bdev, unsigned long block,
* grow_dev_page() will go BUG() if this happens. * grow_dev_page() will go BUG() if this happens.
*/ */
static inline int static inline int
grow_buffers(struct block_device *bdev, unsigned long block, int size) grow_buffers(struct block_device *bdev, sector_t block, int size)
{ {
struct page *page; struct page *page;
unsigned long index; pgoff_t index;
int sizebits; int sizebits;
/* Size must be multiple of hard sectorsize */ /* Size must be multiple of hard sectorsize */
...@@ -1738,8 +1738,8 @@ static int __block_write_full_page(struct inode *inode, struct page *page, ...@@ -1738,8 +1738,8 @@ static int __block_write_full_page(struct inode *inode, struct page *page,
get_block_t *get_block, struct writeback_control *wbc) get_block_t *get_block, struct writeback_control *wbc)
{ {
int err; int err;
unsigned long block; sector_t block;
unsigned long last_block; sector_t last_block;
struct buffer_head *bh, *head; struct buffer_head *bh, *head;
int nr_underway = 0; int nr_underway = 0;
...@@ -2207,7 +2207,7 @@ int cont_prepare_write(struct page *page, unsigned offset, ...@@ -2207,7 +2207,7 @@ int cont_prepare_write(struct page *page, unsigned offset,
struct address_space *mapping = page->mapping; struct address_space *mapping = page->mapping;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
struct page *new_page; struct page *new_page;
unsigned long pgpos; pgoff_t pgpos;
long status; long status;
unsigned zerofrom; unsigned zerofrom;
unsigned blocksize = 1 << inode->i_blkbits; unsigned blocksize = 1 << inode->i_blkbits;
...@@ -2512,9 +2512,11 @@ EXPORT_SYMBOL(nobh_truncate_page); ...@@ -2512,9 +2512,11 @@ EXPORT_SYMBOL(nobh_truncate_page);
int block_truncate_page(struct address_space *mapping, int block_truncate_page(struct address_space *mapping,
loff_t from, get_block_t *get_block) loff_t from, get_block_t *get_block)
{ {
unsigned long index = from >> PAGE_CACHE_SHIFT; pgoff_t index = from >> PAGE_CACHE_SHIFT;
unsigned offset = from & (PAGE_CACHE_SIZE-1); unsigned offset = from & (PAGE_CACHE_SIZE-1);
unsigned blocksize, iblock, length, pos; unsigned blocksize;
pgoff_t iblock;
unsigned length, pos;
struct inode *inode = mapping->host; struct inode *inode = mapping->host;
struct page *page; struct page *page;
struct buffer_head *bh; struct buffer_head *bh;
...@@ -2594,7 +2596,7 @@ int block_write_full_page(struct page *page, get_block_t *get_block, ...@@ -2594,7 +2596,7 @@ int block_write_full_page(struct page *page, get_block_t *get_block,
{ {
struct inode * const inode = page->mapping->host; struct inode * const inode = page->mapping->host;
loff_t i_size = i_size_read(inode); loff_t i_size = i_size_read(inode);
const unsigned long end_index = i_size >> PAGE_CACHE_SHIFT; const pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
unsigned offset; unsigned offset;
void *kaddr; void *kaddr;
......
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