orangefs: write range tracking

Attach the actual range of bytes written to plus the responsible uid/gid
to each dirty page.  This information must be sent to the server when
the page is written out.

Now write_begin, page_mkwrite, and invalidatepage keep up with this
information.  There are several conditions where they must write out the
page immediately to store the new range.  Two non-contiguous ranges
cannot be stored on a single page.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
This commit is contained in:
Martin Brandenburg
2018-12-14 15:24:43 -05:00
committed by Mike Marshall
parent 90fc07065a
commit 52e2d0a380
3 changed files with 274 additions and 35 deletions

View File

@@ -230,6 +230,13 @@ struct orangefs_cached_xattr {
unsigned long timeout;
};
struct orangefs_write_range {
loff_t pos;
size_t len;
kuid_t uid;
kgid_t gid;
};
extern struct orangefs_stats orangefs_stats;
/*
@@ -342,6 +349,7 @@ void fsid_key_table_finalize(void);
/*
* defined in inode.c
*/
vm_fault_t orangefs_page_mkwrite(struct vm_fault *);
struct inode *orangefs_new_inode(struct super_block *sb,
struct inode *dir,
int mode,
@@ -383,7 +391,7 @@ bool __is_daemon_in_service(void);
* defined in file.c
*/
ssize_t wait_for_direct_io(enum ORANGEFS_io_type, struct inode *, loff_t *,
struct iov_iter *, size_t, loff_t);
struct iov_iter *, size_t, loff_t, struct orangefs_write_range *);
ssize_t do_readv_writev(enum ORANGEFS_io_type, struct file *, loff_t *,
struct iov_iter *);