Initial IBM OpenAFS 1.0 tree
[openafs.git] / src / vol / namei_ops.h
1 /* User space file system operations for Unix platforms. */
2
3 #ifndef _AFS_NAMEI_OPS_H_H_
4 #define _AFS_NAMEI_OPS_H_H_
5
6 #ifdef AFS_NAMEI_ENV
7
8 #ifdef notdef
9 /* We don't include Unix afssyscalls.h, so: */
10 #define VALID_INO(I) ((I != (__int64)-1) && (I != (__int64)0))
11
12 /* minimum size of string to hand to PrintInode */
13 #define AFS_INO_STR_LENGTH 32
14 typedef char afs_ino_str_t[AFS_INO_STR_LENGTH];
15
16 char *PrintInode(char *s, Inode ino);
17 #endif
18
19 /* Basic file operations */
20 extern FILE *namei_fdopen(IHandle_t *h, char *fdperms);
21 extern int namei_unlink(char *name);
22
23 /* Inode operations */
24 extern Inode namei_MakeSpecIno(int volid, int type);
25 extern Inode namei_icreate(IHandle_t *h, char *p, int p1, int p2, int p3, int p4);
26 extern FD_t namei_iopen(IHandle_t *h);
27 extern int namei_irelease(IHandle_t *h);
28 int namei_iread(IHandle_t *h, int offset, char *buf, int size);
29 int namei_iwrite(IHandle_t *h, int offset, char *buf, int size);
30 extern int namei_dec(IHandle_t *h, Inode ino, int p1);
31 extern int namei_inc(IHandle_t *h, Inode ino, int p1);
32 extern int namei_GetLinkCount(FdHandle_t *h, Inode ino, int lockit);
33 extern int namei_ViceREADME(char *partition);
34 #include "nfs.h"
35 #include "viceinode.h"
36 int namei_ListAFSFiles(char *dev,
37                     int (*write_fun)(FILE *fp, struct ViceInodeInfo *info,
38                                      char *dir, char *file),
39                     FILE *fp,
40                     int (*judge_fun)(struct ViceInodeInfo *info, int vid),
41                     int singleVolumeNumber);
42 int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
43                    int (*judgeInode)(struct ViceInodeInfo *info, int vid),
44                    int singleVolumeNumber, int *forcep,
45                    int forceR, char *wpath);
46
47
48 #define NAMEI_LCOMP_LEN 32
49 #define NAMEI_SCOMP_LEN 12
50 #define NAMEI_PATH_LEN 256
51 typedef struct {
52     char n_base[NAMEI_LCOMP_LEN];
53     char n_voldir1[NAMEI_SCOMP_LEN];
54     char n_voldir2[NAMEI_LCOMP_LEN];
55     char n_dir1[NAMEI_SCOMP_LEN];
56     char n_dir2[NAMEI_SCOMP_LEN];
57     char n_inode[NAMEI_LCOMP_LEN];
58     char n_path[NAMEI_PATH_LEN];
59 } namei_t;
60 void namei_HandleToName(namei_t *name, IHandle_t *h);
61
62 #endif /* AFS_NAMEI_ENV */
63  
64 #endif /* _AFS_NAMEI_OPS_H_H_ */