aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/ops_address.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/ops_address.c')
-rw-r--r--fs/gfs2/ops_address.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 16d3ebd32092..207363aed112 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -81,7 +81,6 @@ int gfs2_get_block(struct inode *inode, sector_t lblock,
81static int get_block_noalloc(struct inode *inode, sector_t lblock, 81static int get_block_noalloc(struct inode *inode, sector_t lblock,
82 struct buffer_head *bh_result, int create) 82 struct buffer_head *bh_result, int create)
83{ 83{
84 struct gfs2_inode *ip = inode->u.generic_ip;
85 int new = 0; 84 int new = 0;
86 uint64_t dblock; 85 uint64_t dblock;
87 int error; 86 int error;
@@ -93,7 +92,7 @@ static int get_block_noalloc(struct inode *inode, sector_t lblock,
93 92
94 if (dblock) 93 if (dblock)
95 map_bh(bh_result, inode->i_sb, dblock); 94 map_bh(bh_result, inode->i_sb, dblock);
96 else if (gfs2_assert_withdraw(ip->i_sbd, !create)) 95 else if (gfs2_assert_withdraw(GFS2_SB(inode), !create))
97 error = -EIO; 96 error = -EIO;
98 if (boundary) 97 if (boundary)
99 set_buffer_boundary(bh_result); 98 set_buffer_boundary(bh_result);
@@ -114,8 +113,8 @@ static int get_block_noalloc(struct inode *inode, sector_t lblock,
114static int gfs2_writepage(struct page *page, struct writeback_control *wbc) 113static int gfs2_writepage(struct page *page, struct writeback_control *wbc)
115{ 114{
116 struct inode *inode = page->mapping->host; 115 struct inode *inode = page->mapping->host;
117 struct gfs2_inode *ip = page->mapping->host->u.generic_ip; 116 struct gfs2_inode *ip = GFS2_I(page->mapping->host);
118 struct gfs2_sbd *sdp = ip->i_sbd; 117 struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host);
119 loff_t i_size = i_size_read(inode); 118 loff_t i_size = i_size_read(inode);
120 pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT; 119 pgoff_t end_index = i_size >> PAGE_CACHE_SHIFT;
121 unsigned offset; 120 unsigned offset;
@@ -216,8 +215,8 @@ static int stuffed_readpage(struct gfs2_inode *ip, struct page *page)
216 215
217static int gfs2_readpage(struct file *file, struct page *page) 216static int gfs2_readpage(struct file *file, struct page *page)
218{ 217{
219 struct gfs2_inode *ip = page->mapping->host->u.generic_ip; 218 struct gfs2_inode *ip = GFS2_I(page->mapping->host);
220 struct gfs2_sbd *sdp = ip->i_sbd; 219 struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host);
221 struct gfs2_holder gh; 220 struct gfs2_holder gh;
222 int error; 221 int error;
223 222
@@ -271,8 +270,8 @@ static int gfs2_readpages(struct file *file, struct address_space *mapping,
271 struct list_head *pages, unsigned nr_pages) 270 struct list_head *pages, unsigned nr_pages)
272{ 271{
273 struct inode *inode = mapping->host; 272 struct inode *inode = mapping->host;
274 struct gfs2_inode *ip = inode->u.generic_ip; 273 struct gfs2_inode *ip = GFS2_I(inode);
275 struct gfs2_sbd *sdp = ip->i_sbd; 274 struct gfs2_sbd *sdp = GFS2_SB(inode);
276 struct gfs2_holder gh; 275 struct gfs2_holder gh;
277 unsigned page_idx; 276 unsigned page_idx;
278 int ret; 277 int ret;
@@ -345,8 +344,8 @@ out_unlock:
345static int gfs2_prepare_write(struct file *file, struct page *page, 344static int gfs2_prepare_write(struct file *file, struct page *page,
346 unsigned from, unsigned to) 345 unsigned from, unsigned to)
347{ 346{
348 struct gfs2_inode *ip = page->mapping->host->u.generic_ip; 347 struct gfs2_inode *ip = GFS2_I(page->mapping->host);
349 struct gfs2_sbd *sdp = ip->i_sbd; 348 struct gfs2_sbd *sdp = GFS2_SB(page->mapping->host);
350 unsigned int data_blocks, ind_blocks, rblocks; 349 unsigned int data_blocks, ind_blocks, rblocks;
351 int alloc_required; 350 int alloc_required;
352 int error = 0; 351 int error = 0;
@@ -440,8 +439,8 @@ static int gfs2_commit_write(struct file *file, struct page *page,
440 unsigned from, unsigned to) 439 unsigned from, unsigned to)
441{ 440{
442 struct inode *inode = page->mapping->host; 441 struct inode *inode = page->mapping->host;
443 struct gfs2_inode *ip = inode->u.generic_ip; 442 struct gfs2_inode *ip = GFS2_I(inode);
444 struct gfs2_sbd *sdp = ip->i_sbd; 443 struct gfs2_sbd *sdp = GFS2_SB(inode);
445 int error = -EOPNOTSUPP; 444 int error = -EOPNOTSUPP;
446 struct buffer_head *dibh; 445 struct buffer_head *dibh;
447 struct gfs2_alloc *al = &ip->i_alloc;; 446 struct gfs2_alloc *al = &ip->i_alloc;;
@@ -520,7 +519,7 @@ fail_nounlock:
520 519
521static sector_t gfs2_bmap(struct address_space *mapping, sector_t lblock) 520static sector_t gfs2_bmap(struct address_space *mapping, sector_t lblock)
522{ 521{
523 struct gfs2_inode *ip = mapping->host->u.generic_ip; 522 struct gfs2_inode *ip = GFS2_I(mapping->host);
524 struct gfs2_holder i_gh; 523 struct gfs2_holder i_gh;
525 sector_t dblock = 0; 524 sector_t dblock = 0;
526 int error; 525 int error;
@@ -594,7 +593,7 @@ static ssize_t gfs2_direct_IO_write(struct kiocb *iocb, const struct iovec *iov,
594{ 593{
595 struct file *file = iocb->ki_filp; 594 struct file *file = iocb->ki_filp;
596 struct inode *inode = file->f_mapping->host; 595 struct inode *inode = file->f_mapping->host;
597 struct gfs2_inode *ip = inode->u.generic_ip; 596 struct gfs2_inode *ip = GFS2_I(inode);
598 struct gfs2_holder gh; 597 struct gfs2_holder gh;
599 int rv; 598 int rv;
600 599
@@ -641,8 +640,8 @@ static ssize_t gfs2_direct_IO(int rw, struct kiocb *iocb,
641{ 640{
642 struct file *file = iocb->ki_filp; 641 struct file *file = iocb->ki_filp;
643 struct inode *inode = file->f_mapping->host; 642 struct inode *inode = file->f_mapping->host;
644 struct gfs2_inode *ip = inode->u.generic_ip; 643 struct gfs2_inode *ip = GFS2_I(inode);
645 struct gfs2_sbd *sdp = ip->i_sbd; 644 struct gfs2_sbd *sdp = GFS2_SB(inode);
646 645
647 if (rw == WRITE) 646 if (rw == WRITE)
648 return gfs2_direct_IO_write(iocb, iov, offset, nr_segs); 647 return gfs2_direct_IO_write(iocb, iov, offset, nr_segs);