Skip to content

Commit 8d39197

Browse files
Matthew Wilcox (Oracle)Andreas Gruenbacher
authored andcommitted
gfs2: Remove __gfs2_writepage()
Call aops->writepages() instead of using write_cache_pages() to call aops->writepage. Change the handling of -ENODATA to not set the persistent error on the block device. Signed-off-by: Matthew Wilcox (Oracle) <[email protected]> Signed-off-by: Andreas Gruenbacher <[email protected]>
1 parent 901849e commit 8d39197

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

fs/gfs2/log.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,6 @@ void gfs2_remove_from_ail(struct gfs2_bufdata *bd)
8080
brelse(bd->bd_bh);
8181
}
8282

83-
static int __gfs2_writepage(struct folio *folio, struct writeback_control *wbc,
84-
void *data)
85-
{
86-
struct address_space *mapping = data;
87-
int ret = mapping->a_ops->writepage(&folio->page, wbc);
88-
mapping_set_error(mapping, ret);
89-
return ret;
90-
}
91-
9283
/**
9384
* gfs2_ail1_start_one - Start I/O on a transaction
9485
* @sdp: The superblock
@@ -140,7 +131,7 @@ __acquires(&sdp->sd_ail_lock)
140131
if (!mapping)
141132
continue;
142133
spin_unlock(&sdp->sd_ail_lock);
143-
ret = write_cache_pages(mapping, wbc, __gfs2_writepage, mapping);
134+
ret = mapping->a_ops->writepages(mapping, wbc);
144135
if (need_resched()) {
145136
blk_finish_plug(plug);
146137
cond_resched();
@@ -149,6 +140,7 @@ __acquires(&sdp->sd_ail_lock)
149140
spin_lock(&sdp->sd_ail_lock);
150141
if (ret == -ENODATA) /* if a jdata write into a new hole */
151142
ret = 0; /* ignore it */
143+
mapping_set_error(mapping, ret);
152144
if (ret || wbc->nr_to_write <= 0)
153145
break;
154146
return -EBUSY;

0 commit comments

Comments
 (0)