diff options
author | Christoph Hellwig <hch@lst.de> | 2019-07-01 23:54:33 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruenba@redhat.com> | 2019-07-03 14:45:09 +0200 |
commit | eadd753580469f281912e28114a80e5822622cbe (patch) | |
tree | 549d65b81a6288c23cb7a9f5b936fde0ca0efcd5 /fs/gfs2 | |
parent | e0ec0a6ba6574594f444383efbc09e621d1d8dee (diff) | |
download | linux-eadd753580469f281912e28114a80e5822622cbe.tar.gz linux-eadd753580469f281912e28114a80e5822622cbe.tar.bz2 linux-eadd753580469f281912e28114a80e5822622cbe.zip |
gfs2: merge gfs2_writeback_aops and gfs2_ordered_aops
The only difference between the two is that gfs2_ordered_aops sets the
set_page_dirty method to __set_page_dirty_buffers, but given that
__set_page_dirty_buffers is the default, if no method is set, there is no need
to to do that. Merge the two sets of operations into one.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/aops.c | 28 |
1 files changed, 3 insertions, 25 deletions
diff --git a/fs/gfs2/aops.c b/fs/gfs2/aops.c index d82b919ce70f..210e4a8d4e7b 100644 --- a/fs/gfs2/aops.c +++ b/fs/gfs2/aops.c @@ -847,7 +847,7 @@ cannot_release: return 0; } -static const struct address_space_operations gfs2_writeback_aops = { +static const struct address_space_operations gfs2_aops = { .writepage = gfs2_writepage, .writepages = gfs2_writepages, .readpage = gfs2_readpage, @@ -861,21 +861,6 @@ static const struct address_space_operations gfs2_writeback_aops = { .error_remove_page = generic_error_remove_page, }; -static const struct address_space_operations gfs2_ordered_aops = { - .writepage = gfs2_writepage, - .writepages = gfs2_writepages, - .readpage = gfs2_readpage, - .readpages = gfs2_readpages, - .set_page_dirty = __set_page_dirty_buffers, - .bmap = gfs2_bmap, - .invalidatepage = gfs2_invalidatepage, - .releasepage = gfs2_releasepage, - .direct_IO = noop_direct_IO, - .migratepage = buffer_migrate_page, - .is_partially_uptodate = block_is_partially_uptodate, - .error_remove_page = generic_error_remove_page, -}; - static const struct address_space_operations gfs2_jdata_aops = { .writepage = gfs2_jdata_writepage, .writepages = gfs2_jdata_writepages, @@ -891,15 +876,8 @@ static const struct address_space_operations gfs2_jdata_aops = { void gfs2_set_aops(struct inode *inode) { - struct gfs2_inode *ip = GFS2_I(inode); - struct gfs2_sbd *sdp = GFS2_SB(inode); - - if (gfs2_is_jdata(ip)) + if (gfs2_is_jdata(GFS2_I(inode))) inode->i_mapping->a_ops = &gfs2_jdata_aops; - else if (gfs2_is_writeback(sdp)) - inode->i_mapping->a_ops = &gfs2_writeback_aops; - else if (gfs2_is_ordered(sdp)) - inode->i_mapping->a_ops = &gfs2_ordered_aops; else - BUG(); + inode->i_mapping->a_ops = &gfs2_aops; } |