diff options
author | David Howells <dhowells@redhat.com> | 2018-04-06 14:17:24 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2018-04-09 21:53:59 +0100 |
commit | dd9fbcb8e10349fbd640aaa5942455912004f284 (patch) | |
tree | f77b3d38b5abc531f8b47aef6a27a1ab979cc657 /fs/afs/internal.h | |
parent | 0c3a5ac28115f45ee1d56717d9a9526bc6d63b05 (diff) | |
download | lwn-dd9fbcb8e10349fbd640aaa5942455912004f284.tar.gz lwn-dd9fbcb8e10349fbd640aaa5942455912004f284.zip |
afs: Rearrange status mapping
Rearrange the AFSFetchStatus to inode attribute mapping code in a number of
ways:
(1) Use an XDR structure rather than a series of incremented pointer
accesses when decoding an AFSFetchStatus object. This allows
out-of-order decode.
(2) Don't store the if_version value but rather just check it and abort if
it's not something we can handle.
(3) Store the owner and group in the status record as raw values rather
than converting them to kuid/kgid. Do that when they're mapped into
i_uid/i_gid.
(4) Validate the type and abort code up front and abort if they're wrong.
(5) Split the inode attribute setting out into its own function from the
XDR decode of an AFSFetchStatus object. This allows it to be called
from elsewhere too.
(6) Differentiate changes to data from changes to metadata.
(7) Use the split-out attribute mapping function from afs_iget().
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r-- | fs/afs/internal.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h index 6b72807c40af..ac3076c2a8e8 100644 --- a/fs/afs/internal.h +++ b/fs/afs/internal.h @@ -704,6 +704,12 @@ extern int afs_flock(struct file *, int, struct file_lock *); /* * fsclient.c */ +#define AFS_VNODE_NOT_YET_SET 0x01 +#define AFS_VNODE_META_CHANGED 0x02 +#define AFS_VNODE_DATA_CHANGED 0x04 +extern void afs_update_inode_from_status(struct afs_vnode *, struct afs_file_status *, + const afs_dataversion_t *, u8); + extern int afs_fs_fetch_file_status(struct afs_fs_cursor *, struct afs_volsync *, bool); extern int afs_fs_give_up_callbacks(struct afs_net *, struct afs_server *); extern int afs_fs_fetch_data(struct afs_fs_cursor *, struct afs_read *); |