summaryrefslogtreecommitdiff
path: root/fs/gfs2/ops_address.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2006-03-31 16:48:41 -0500
committerSteven Whitehouse <swhiteho@redhat.com>2006-03-31 16:48:41 -0500
commit8628de0583504138551a05ad44ca388467f0f552 (patch)
tree15a0e85dca99d74e54765a71fe2f59c4228d68c1 /fs/gfs2/ops_address.c
parent86579dd06deecfa6ac88d5e84e4d63c397cd6f6d (diff)
[GFS2] Update GFS2 for the recent pull from Linus
Some interfaces have changed. In particular one of the posix locking functions has changed prototype, along with the address space operation invalidatepage and the block getting callback to the direct IO function. In addition add the splice file operations. These will need to be updated to support AOP_TRUNCATED_PAGE before they will be of much use to us. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/ops_address.c')
-rw-r--r--fs/gfs2/ops_address.c66
1 files changed, 6 insertions, 60 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 01aa4a9b48c..3fd8c6ec256 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -96,59 +96,6 @@ static int get_block_noalloc(struct inode *inode, sector_t lblock,
return error;
}
-static int get_blocks(struct inode *inode, sector_t lblock,
- unsigned long max_blocks, struct buffer_head *bh_result,
- int create)
-{
- struct gfs2_inode *ip = inode->u.generic_ip;
- int new = create;
- uint64_t dblock;
- uint32_t extlen;
- int error;
-
- error = gfs2_block_map(ip, lblock, &new, &dblock, &extlen);
- if (error)
- return error;
-
- if (!dblock)
- return 0;
-
- map_bh(bh_result, inode->i_sb, dblock);
- if (new)
- set_buffer_new(bh_result);
-
- if (extlen > max_blocks)
- extlen = max_blocks;
- bh_result->b_size = extlen << inode->i_blkbits;
-
- return 0;
-}
-
-static int get_blocks_noalloc(struct inode *inode, sector_t lblock,
- unsigned long max_blocks,
- struct buffer_head *bh_result, int create)
-{
- struct gfs2_inode *ip = inode->u.generic_ip;
- int new = 0;
- uint64_t dblock;
- uint32_t extlen;
- int error;
-
- error = gfs2_block_map(ip, lblock, &new, &dblock, &extlen);
- if (error)
- return error;
-
- if (dblock) {
- map_bh(bh_result, inode->i_sb, dblock);
- if (extlen > max_blocks)
- extlen = max_blocks;
- bh_result->b_size = extlen << inode->i_blkbits;
- } else if (gfs2_assert_withdraw(ip->i_sbd, !create))
- error = -EIO;
-
- return error;
-}
-
/**
* gfs2_writepage - Write complete page
* @page: Page to write
@@ -527,16 +474,15 @@ static void discard_buffer(struct gfs2_sbd *sdp, struct buffer_head *bh)
unlock_buffer(bh);
}
-static int gfs2_invalidatepage(struct page *page, unsigned long offset)
+static void gfs2_invalidatepage(struct page *page, unsigned long offset)
{
struct gfs2_sbd *sdp = page->mapping->host->i_sb->s_fs_info;
struct buffer_head *head, *bh, *next;
unsigned int curr_off = 0;
- int ret = 1;
BUG_ON(!PageLocked(page));
if (!page_has_buffers(page))
- return 1;
+ return;
bh = head = page_buffers(page);
do {
@@ -551,9 +497,9 @@ static int gfs2_invalidatepage(struct page *page, unsigned long offset)
} while (bh != head);
if (!offset)
- ret = try_to_release_page(page, 0);
+ try_to_release_page(page, 0);
- return ret;
+ return;
}
static ssize_t gfs2_direct_IO_write(struct kiocb *iocb, const struct iovec *iov,
@@ -587,7 +533,7 @@ static ssize_t gfs2_direct_IO_write(struct kiocb *iocb, const struct iovec *iov,
goto out;
rv = __blockdev_direct_IO(WRITE, iocb, inode, inode->i_sb->s_bdev,
- iov, offset, nr_segs, get_blocks_noalloc,
+ iov, offset, nr_segs, gfs2_get_block,
NULL, DIO_OWN_LOCKING);
out:
gfs2_glock_dq_m(1, &gh);
@@ -619,7 +565,7 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
return -EINVAL;
return __blockdev_direct_IO(READ, iocb, inode, inode->i_sb->s_bdev, iov,
- offset, nr_segs, get_blocks, NULL,
+ offset, nr_segs, gfs2_get_block, NULL,
DIO_OWN_LOCKING);
}