forked from allspace/eunfs3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
afssupport.h
62 lines (49 loc) · 1.39 KB
/
afssupport.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* unfs3 AFS FID support layer
* Copyright (c) 2008 Daniel Richard G. <[email protected]>
* see file LICENSE for license details
*/
#ifdef AFS_SUPPORT
#ifndef UNFS3_AFSSUPPORT_H
#define UNFS3_AFSSUPPORT_H
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include "nfs.h"
/* Linux's /usr/include/bits/stat.h has this nonsense:
*
* # define st_atime st_atim.tv_sec /+ Backward compatibility. +/
* # define st_mtime st_mtim.tv_sec
* # define st_ctime st_ctim.tv_sec
*/
#undef st_atime
#undef st_mtime
#undef st_ctime
struct stat_plus_afs {
dev_t st_dev;
uint64 st_ino; /* Must be unconditionally 64-bit */
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
off_t st_size;
size_t st_blksize;
blkcnt_t st_blocks;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
/* Following fields are valid only if this is non-zero
*/
int afs_valid;
int32 afs_cell;
uint32 afs_volume;
uint32 afs_vnode;
uint32 afs_unique;
};
uint32 afs_get_gen(struct stat_plus_afs obuf, int fd, const char *path);
int afs_stat(const char *file_name, struct stat_plus_afs *buf);
int afs_fstat(int fd, struct stat_plus_afs *buf);
int afs_lstat(const char *path, struct stat_plus_afs *buf);
#endif /* UNFS3_AFSSUPPORT_H */
#endif /* AFS_SUPPORT */