2 * Copyright 2000, International Business Machines Corporation and others.
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
10 /* User space file system operations for Unix platforms. */
12 #ifndef _AFS_NAMEI_OPS_H_H_
13 #define _AFS_NAMEI_OPS_H_H_
18 /* We don't include Unix afssyscalls.h, so: */
19 #define VALID_INO(I) ((I != (__int64)-1) && (I != (__int64)0))
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];
25 char *PrintInode(char *s, Inode ino);
28 /* Basic file operations */
29 extern FILE *namei_fdopen(IHandle_t * h, char *fdperms);
30 extern int namei_unlink(char *name);
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,
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,
40 afs_sfsize_t namei_iwrite(IHandle_t * h, afs_foff_t offset, char *buf,
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_SetLinkCount(FdHandle_t * h, Inode ino, int count, int locked);
46 extern int namei_ViceREADME(char *partition);
48 #include "viceinode.h"
49 int namei_ListAFSFiles(char *dev,
50 int (*write_fun) (FILE * fp,
51 struct ViceInodeInfo * info,
52 char *dir, char *file), FILE * fp,
53 int (*judge_fun) (struct ViceInodeInfo * info,
55 int singleVolumeNumber, void *rock);
56 int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
57 int (*judgeInode) (struct ViceInodeInfo * info, int vid,
59 int singleVolumeNumber, int *forcep, int forceR,
60 char *wpath, void *rock);
63 #define NAMEI_LCOMP_LEN 32
64 #define NAMEI_SCOMP_LEN 12
65 #define NAMEI_PATH_LEN 256
67 char n_base[NAMEI_LCOMP_LEN];
68 char n_voldir1[NAMEI_SCOMP_LEN];
69 char n_voldir2[NAMEI_LCOMP_LEN];
70 char n_dir1[NAMEI_SCOMP_LEN];
71 char n_dir2[NAMEI_SCOMP_LEN];
72 char n_inode[NAMEI_LCOMP_LEN];
73 char n_path[NAMEI_PATH_LEN];
75 void namei_HandleToName(namei_t * name, IHandle_t * h);
77 #endif /* AFS_NAMEI_ENV */
79 #endif /* _AFS_NAMEI_OPS_H_H_ */