afs: Rearrange status mapping
authorDavid Howells <dhowells@redhat.com>
Fri, 6 Apr 2018 13:17:24 +0000 (14:17 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 9 Apr 2018 20:53:59 +0000 (21:53 +0100)
commitdd9fbcb8e10349fbd640aaa5942455912004f284
treef77b3d38b5abc531f8b47aef6a27a1ab979cc657
parent0c3a5ac28115f45ee1d56717d9a9526bc6d63b05
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>
fs/afs/afs.h
fs/afs/fsclient.c
fs/afs/inode.c
fs/afs/internal.h
fs/afs/xdr_fs.h [new file with mode: 0644]