From eadd753580469f281912e28114a80e5822622cbe Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 1 Jul 2019 23:54:33 +0200 Subject: [PATCH] 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 Signed-off-by: Andreas Gruenbacher --- fs/gfs2/aops.c | 28 +++------------------------- 1 file 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; }