netfs: Replace PG_fscache by setting folio->private and marking dirty
When dirty data is being written to the cache, setting/waiting on/clearing the fscache flag is always done in tandem with setting/waiting on/clearing the writeback flag. The netfslib buffered write routines wait on and set both flags and the write request cleanup clears both flags, so the fscache flag is almost superfluous. The reason it isn't superfluous is because the fscache flag is also used to indicate that data just read from the server is being written to the cache. The flag is used to prevent a race involving overlapping direct-I/O writes to the cache. Change this to indicate that a page is in need of being copied to the cache by placing a magic value in folio->private and marking the folios dirty. Then when the writeback code sees a folio marked in this way, it only writes it to the cache and not to the server. If a folio that has this magic value set is modified, the value is just replaced and the folio will then be uploda...
Showing
- fs/ceph/addr.c 1 addition, 1 deletionfs/ceph/addr.c
- fs/ceph/inode.c 2 additions, 0 deletionsfs/ceph/inode.c
- fs/netfs/buffered_read.c 26 additions, 10 deletionsfs/netfs/buffered_read.c
- fs/netfs/buffered_write.c 44 additions, 49 deletionsfs/netfs/buffered_write.c
- fs/netfs/fscache_io.c 8 additions, 4 deletionsfs/netfs/fscache_io.c
- fs/netfs/internal.h 7 additions, 3 deletionsfs/netfs/internal.h
- fs/netfs/io.c 10 additions, 8 deletionsfs/netfs/io.c
- fs/netfs/main.c 1 addition, 0 deletionsfs/netfs/main.c
- fs/netfs/misc.c 1 addition, 9 deletionsfs/netfs/misc.c
- fs/netfs/objects.c 5 additions, 1 deletionfs/netfs/objects.c
- fs/nfs/fscache.h 2 additions, 0 deletionsfs/nfs/fscache.h
- include/linux/fscache.h 14 additions, 8 deletionsinclude/linux/fscache.h
- include/linux/netfs.h 17 additions, 3 deletionsinclude/linux/netfs.h
- include/trace/events/netfs.h 5 additions, 1 deletioninclude/trace/events/netfs.h
Please register or sign in to comment