large-file-support-20030808
[openafs.git] / src / vol / namei_ops.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /* User space file system operations for Unix platforms. */
11
12 #ifndef _AFS_NAMEI_OPS_H_H_
13 #define _AFS_NAMEI_OPS_H_H_
14
15 #ifdef AFS_NAMEI_ENV
16
17 #ifdef notdef
18 /* We don't include Unix afssyscalls.h, so: */
19 #define VALID_INO(I) ((I != (__int64)-1) && (I != (__int64)0))
20
21 /* minimum size of string to hand to PrintInode */
22 #define AFS_INO_STR_LENGTH 32
23 typedef char afs_ino_str_t[AFS_INO_STR_LENGTH];
24
25 char *PrintInode(char *s, Inode ino);
26 #endif
27
28 /* Basic file operations */
29 extern FILE *namei_fdopen(IHandle_t * h, char *fdperms);
30 extern int namei_unlink(char *name);
31
32 /* Inode operations */
33 extern Inode namei_MakeSpecIno(int volid, int type);
34 extern Inode namei_icreate(IHandle_t * h, char *p, int p1, int p2, int p3,
35                            int p4);
36 extern FD_t namei_iopen(IHandle_t * h);
37 extern int namei_irelease(IHandle_t * h);
38 afs_sfsize_t namei_iread(IHandle_t * h, afs_foff_t offset, char *buf,
39                          afs_fsize_t size);
40 afs_sfsize_t namei_iwrite(IHandle_t * h, afs_foff_t offset, char *buf,
41                           afs_fsize_t size);
42 extern int namei_dec(IHandle_t * h, Inode ino, int p1);
43 extern int namei_inc(IHandle_t * h, Inode ino, int p1);
44 extern int namei_GetLinkCount(FdHandle_t * h, Inode ino, int lockit);
45 extern int namei_ViceREADME(char *partition);
46 #include "nfs.h"
47 #include "viceinode.h"
48 int namei_ListAFSFiles(char *dev,
49                        int (*write_fun) (FILE * fp,
50                                          struct ViceInodeInfo * info,
51                                          char *dir, char *file), FILE * fp,
52                        int (*judge_fun) (struct ViceInodeInfo * info,
53                                          int vid), int singleVolumeNumber);
54 int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
55                    int (*judgeInode) (struct ViceInodeInfo * info, int vid),
56                    int singleVolumeNumber, int *forcep, int forceR,
57                    char *wpath);
58
59
60 #define NAMEI_LCOMP_LEN 32
61 #define NAMEI_SCOMP_LEN 12
62 #define NAMEI_PATH_LEN 256
63 typedef struct {
64     char n_base[NAMEI_LCOMP_LEN];
65     char n_voldir1[NAMEI_SCOMP_LEN];
66     char n_voldir2[NAMEI_LCOMP_LEN];
67     char n_dir1[NAMEI_SCOMP_LEN];
68     char n_dir2[NAMEI_SCOMP_LEN];
69     char n_inode[NAMEI_LCOMP_LEN];
70     char n_path[NAMEI_PATH_LEN];
71 } namei_t;
72 void namei_HandleToName(namei_t * name, IHandle_t * h);
73
74 #endif /* AFS_NAMEI_ENV */
75
76 #endif /* _AFS_NAMEI_OPS_H_H_ */