Skip to content
Permalink
Browse files
netfs: Generate a buffered writeback from ->writepages()
Handle the initiation of writeback of a piece of the dirty list.  A slice
of a dirty region is extracted and a writeback record is set up to manage
it.  The pages in the affected region are flipped from dirty to
writeback-in-progress.

The writeback is then dispatched (which at this point just logs a message
to dmesg and then abandons it).

Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
dhowells committed Feb 14, 2022
1 parent ebd2b99 commit e73334c9144cee0fd83afee287d7e5950e5d256d
Show file tree
Hide file tree
Showing 8 changed files with 611 additions and 2 deletions.
@@ -55,7 +55,7 @@ const struct address_space_operations afs_file_aops = {
.releasepage = netfs_releasepage,
.invalidatepage = netfs_invalidatepage,
.writepage = afs_writepage,
.writepages = afs_writepages,
.writepages = netfs_writepages,
};

const struct address_space_operations afs_symlink_aops = {
@@ -384,6 +384,11 @@ static void afs_free_dirty_region(struct netfs_dirty_region *region)
key_put(region->netfs_priv);
}

static void afs_init_writeback(struct netfs_writeback *wback)
{
//wback->netfs_priv = key_get(afs_file_key(file));
}

static void afs_update_i_size(struct file *file, loff_t new_i_size)
{
struct afs_vnode *vnode = AFS_FS_I(file_inode(file));
@@ -414,6 +419,7 @@ const struct netfs_request_ops afs_req_ops = {
.free_dirty_region = afs_free_dirty_region,
.update_i_size = afs_update_i_size,
.validate_for_write = afs_validate_for_write,
.init_writeback = afs_init_writeback,
};

int afs_write_inode(struct inode *inode, struct writeback_control *wbc)
@@ -7,6 +7,7 @@ netfs-y := \
misc.o \
objects.o \
read_helper.o \
write_back.o \
write_helper.o

netfs-$(CONFIG_NETFS_STATS) += stats.o

0 comments on commit e73334c

Please sign in to comment.