Skip to content

Commit d73065e

Browse files
committed
afs: Use alternative invalidation to using launder_folio
Use writepages-based flushing invalidation instead of invalidate_inode_pages2() and ->launder_folio(). This will allow ->launder_folio() to be removed eventually. Signed-off-by: David Howells <[email protected]> cc: Marc Dionne <[email protected]> cc: Jeff Layton <[email protected]> cc: [email protected] cc: [email protected] cc: [email protected]
1 parent 40fb482 commit d73065e

File tree

4 files changed

+5
-11
lines changed

4 files changed

+5
-11
lines changed

fs/afs/file.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ const struct address_space_operations afs_file_aops = {
5454
.read_folio = netfs_read_folio,
5555
.readahead = netfs_readahead,
5656
.dirty_folio = netfs_dirty_folio,
57-
.launder_folio = netfs_launder_folio,
5857
.release_folio = netfs_release_folio,
5958
.invalidate_folio = netfs_invalidate_folio,
6059
.migrate_folio = filemap_migrate_folio,

fs/afs/internal.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,6 @@ struct afs_operation {
916916
loff_t pos;
917917
loff_t size;
918918
loff_t i_size;
919-
bool laundering; /* Laundering page, PG_writeback not set */
920919
} store;
921920
struct {
922921
struct iattr *attr;

fs/afs/validation.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,9 @@ static void afs_zap_data(struct afs_vnode *vnode)
365365
* written back in a regular file and completely discard the pages in a
366366
* directory or symlink */
367367
if (S_ISREG(vnode->netfs.inode.i_mode))
368-
invalidate_remote_inode(&vnode->netfs.inode);
368+
filemap_invalidate_inode(&vnode->netfs.inode, true, 0, LLONG_MAX);
369369
else
370-
invalidate_inode_pages2(vnode->netfs.inode.i_mapping);
370+
filemap_invalidate_inode(&vnode->netfs.inode, false, 0, LLONG_MAX);
371371
}
372372

373373
/*

fs/afs/write.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ static void afs_store_data_success(struct afs_operation *op)
7575
op->ctime = op->file[0].scb.status.mtime_client;
7676
afs_vnode_commit_status(op, &op->file[0]);
7777
if (!afs_op_error(op)) {
78-
if (!op->store.laundering)
79-
afs_pages_written_back(vnode, op->store.pos, op->store.size);
78+
afs_pages_written_back(vnode, op->store.pos, op->store.size);
8079
afs_stat_v(vnode, n_stores);
8180
atomic_long_add(op->store.size, &afs_v2net(vnode)->n_store_bytes);
8281
}
@@ -91,8 +90,7 @@ static const struct afs_operation_ops afs_store_data_operation = {
9190
/*
9291
* write to a file
9392
*/
94-
static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos,
95-
bool laundering)
93+
static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t pos)
9694
{
9795
struct afs_operation *op;
9896
struct afs_wb_key *wbk = NULL;
@@ -123,7 +121,6 @@ static int afs_store_data(struct afs_vnode *vnode, struct iov_iter *iter, loff_t
123121
op->file[0].modification = true;
124122
op->store.pos = pos;
125123
op->store.size = size;
126-
op->store.laundering = laundering;
127124
op->flags |= AFS_OPERATION_UNINTR;
128125
op->ops = &afs_store_data_operation;
129126

@@ -168,8 +165,7 @@ static void afs_upload_to_server(struct netfs_io_subrequest *subreq)
168165
subreq->rreq->debug_id, subreq->debug_index, subreq->io_iter.count);
169166

170167
trace_netfs_sreq(subreq, netfs_sreq_trace_submit);
171-
ret = afs_store_data(vnode, &subreq->io_iter, subreq->start,
172-
subreq->rreq->origin == NETFS_LAUNDER_WRITE);
168+
ret = afs_store_data(vnode, &subreq->io_iter, subreq->start);
173169
netfs_write_subrequest_terminated(subreq, ret < 0 ? ret : subreq->len,
174170
false);
175171
}

0 commit comments

Comments
 (0)