Commit d4936803 authored by David Howells's avatar David Howells

afs: Expand data structure fields to support YFS

Expand fields in various data structures to support the expanded
information that YFS is capable of returning.
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent f58db83f
...@@ -130,19 +130,18 @@ typedef u32 afs_access_t; ...@@ -130,19 +130,18 @@ typedef u32 afs_access_t;
struct afs_file_status { struct afs_file_status {
u64 size; /* file size */ u64 size; /* file size */
afs_dataversion_t data_version; /* current data version */ afs_dataversion_t data_version; /* current data version */
time_t mtime_client; /* last time client changed data */ struct timespec64 mtime_client; /* Last time client changed data */
time_t mtime_server; /* last time server changed data */ struct timespec64 mtime_server; /* Last time server changed data */
unsigned abort_code; /* Abort if bulk-fetching this failed */ s64 author; /* author ID */
s64 owner; /* owner ID */
afs_file_type_t type; /* file type */ s64 group; /* group ID */
unsigned nlink; /* link count */
u32 author; /* author ID */
u32 owner; /* owner ID */
u32 group; /* group ID */
afs_access_t caller_access; /* access rights for authenticated caller */ afs_access_t caller_access; /* access rights for authenticated caller */
afs_access_t anon_access; /* access rights for unauthenticated caller */ afs_access_t anon_access; /* access rights for unauthenticated caller */
umode_t mode; /* UNIX mode */ umode_t mode; /* UNIX mode */
afs_file_type_t type; /* file type */
u32 nlink; /* link count */
s32 lock_count; /* file lock count (0=UNLK -1=WRLCK +ve=#RDLCK */ s32 lock_count; /* file lock count (0=UNLK -1=WRLCK +ve=#RDLCK */
u32 abort_code; /* Abort if bulk-fetching this failed */
}; };
/* /*
...@@ -159,25 +158,27 @@ struct afs_file_status { ...@@ -159,25 +158,27 @@ struct afs_file_status {
* AFS volume synchronisation information * AFS volume synchronisation information
*/ */
struct afs_volsync { struct afs_volsync {
time_t creation; /* volume creation time */ time64_t creation; /* volume creation time */
}; };
/* /*
* AFS volume status record * AFS volume status record
*/ */
struct afs_volume_status { struct afs_volume_status {
u32 vid; /* volume ID */ afs_volid_t vid; /* volume ID */
u32 parent_id; /* parent volume ID */ afs_volid_t parent_id; /* parent volume ID */
u8 online; /* true if volume currently online and available */ u8 online; /* true if volume currently online and available */
u8 in_service; /* true if volume currently in service */ u8 in_service; /* true if volume currently in service */
u8 blessed; /* same as in_service */ u8 blessed; /* same as in_service */
u8 needs_salvage; /* true if consistency checking required */ u8 needs_salvage; /* true if consistency checking required */
u32 type; /* volume type (afs_voltype_t) */ u32 type; /* volume type (afs_voltype_t) */
u32 min_quota; /* minimum space set aside (blocks) */ u64 min_quota; /* minimum space set aside (blocks) */
u32 max_quota; /* maximum space this volume may occupy (blocks) */ u64 max_quota; /* maximum space this volume may occupy (blocks) */
u32 blocks_in_use; /* space this volume currently occupies (blocks) */ u64 blocks_in_use; /* space this volume currently occupies (blocks) */
u32 part_blocks_avail; /* space available in volume's partition */ u64 part_blocks_avail; /* space available in volume's partition */
u32 part_max_blocks; /* size of volume's partition */ u64 part_max_blocks; /* size of volume's partition */
s64 vol_copy_date;
s64 vol_backup_date;
}; };
#define AFS_BLOCK_SIZE 1024 #define AFS_BLOCK_SIZE 1024
......
...@@ -69,8 +69,7 @@ void afs_update_inode_from_status(struct afs_vnode *vnode, ...@@ -69,8 +69,7 @@ void afs_update_inode_from_status(struct afs_vnode *vnode,
struct timespec64 t; struct timespec64 t;
umode_t mode; umode_t mode;
t.tv_sec = status->mtime_client; t = status->mtime_client;
t.tv_nsec = 0;
vnode->vfs_inode.i_ctime = t; vnode->vfs_inode.i_ctime = t;
vnode->vfs_inode.i_mtime = t; vnode->vfs_inode.i_mtime = t;
vnode->vfs_inode.i_atime = t; vnode->vfs_inode.i_atime = t;
...@@ -194,8 +193,10 @@ static int xdr_decode_AFSFetchStatus(struct afs_call *call, ...@@ -194,8 +193,10 @@ static int xdr_decode_AFSFetchStatus(struct afs_call *call,
EXTRACT_M(mode); EXTRACT_M(mode);
EXTRACT_M(group); EXTRACT_M(group);
status->mtime_client = ntohl(xdr->mtime_client); status->mtime_client.tv_sec = ntohl(xdr->mtime_client);
status->mtime_server = ntohl(xdr->mtime_server); status->mtime_client.tv_nsec = 0;
status->mtime_server.tv_sec = ntohl(xdr->mtime_server);
status->mtime_server.tv_nsec = 0;
status->lock_count = ntohl(xdr->lock_count); status->lock_count = ntohl(xdr->lock_count);
size = (u64)ntohl(xdr->size_lo); size = (u64)ntohl(xdr->size_lo);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment