forked from allspace/eunfs3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fh.h
62 lines (48 loc) · 1.44 KB
/
fh.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 low-level filehandle routines
* (C) 2004, Pascal Schmidt
* see file LICENSE for license details
*/
#ifndef UNFS3_FH_H
#define UNFS3_FH_H
#include "backend.h"
/* minimum length of complete filehandle */
#define FH_MINLEN 21
/* maximum depth of pathname described by filehandle */
#define FH_MAXLEN (64 - FH_MINLEN)
#ifdef __GNUC__
typedef struct {
uint32 dev;
uint64 ino;
uint32 gen;
uint32 pwhash;
unsigned char len;
unsigned char inos[FH_MAXLEN];
} __attribute__((packed)) unfs3_fh_t;
#else
#pragma pack(1)
typedef struct {
uint32 dev;
uint64 ino;
uint32 gen;
uint32 pwhash;
unsigned char len;
unsigned char inos[FH_MAXLEN];
} unfs3_fh_t;
#pragma pack(4)
#endif
#define FH_ANY 0
#define FH_DIR 1
#define FD_NONE (-1) /* used for get_gen */
extern int st_cache_valid; /* stat value is valid */
extern backend_statstruct st_cache; /* cached stat value */
uint32 get_gen(backend_statstruct obuf, int fd, const char *path);
int nfh_valid(nfs_fh3 fh);
int fh_valid(unfs3_fh_t fh);
unfs3_fh_t fh_comp_raw(const char *path, struct svc_req *rqstp, int need_dir);
u_int fh_length(const unfs3_fh_t *fh);
unfs3_fh_t *fh_extend(nfs_fh3 fh, uint32 dev, uint64 ino, uint32 gen);
post_op_fh3 fh_extend_post(nfs_fh3 fh, uint32 dev, uint64 ino, uint32 gen);
post_op_fh3 fh_extend_type(nfs_fh3 fh, const char *path, unsigned int type);
char *fh_decomp_raw(const unfs3_fh_t *fh);
#endif