Skip to content

Commit

Permalink
netfs: Generate a buffered writeback from ->writepages()
Browse files Browse the repository at this point in the history
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 e73334c
Show file tree
Hide file tree
Showing 8 changed files with 611 additions and 2 deletions.
8 changes: 7 additions & 1 deletion fs/afs/file.c
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions fs/netfs/Makefile
Expand Up @@ -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
Expand Down

0 comments on commit e73334c

Please sign in to comment.