Import Upstream version 1.8.5
[hcoop/debian/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 /* Basic file operations */
18 extern FD_t namei_fdopen(IHandle_t * h, char *fdperms);
19 extern int namei_unlink(char *name);
20
21 /* Inode operations */
22 extern Inode namei_MakeSpecIno(VolumeId volid, int type);
23 extern Inode namei_icreate(IHandle_t * lh, char *part, afs_uint32 p1,
24 afs_uint32 p2, afs_uint32 p3, afs_uint32 p4);
25 extern IHandle_t *namei_icreate_init(IHandle_t *lh, int dev, char *part,
26 afs_uint32 p1, afs_uint32 p2,
27 afs_uint32 p3, afs_uint32 p4);
28 extern FD_t namei_iopen(IHandle_t * h);
29 extern int namei_irelease(IHandle_t * h);
30 afs_sfsize_t namei_iread(IHandle_t * h, afs_foff_t offset, char *buf,
31 afs_fsize_t size);
32 afs_sfsize_t namei_iwrite(IHandle_t * h, afs_foff_t offset, char *buf,
33 afs_fsize_t size);
34 extern int namei_dec(IHandle_t * h, Inode ino, int p1);
35 extern int namei_inc(IHandle_t * h, Inode ino, int p1);
36 extern int namei_GetLinkCount(FdHandle_t * h, Inode ino, int lockit, int fixup, int nowrite);
37 extern int namei_SetLinkCount(FdHandle_t * h, Inode ino, int count, int locked);
38 extern int namei_ViceREADME(char *partition);
39 extern int namei_FixSpecialOGM(FdHandle_t *h, int check);
40 #include "nfs.h"
41 #include "viceinode.h"
42 int namei_ListAFSFiles(char *dev,
43 int (*write_fun) (FD_t fp,
44 struct ViceInodeInfo * info,
45 char *dir, char *file), FD_t fp,
46 int (*judge_fun) (struct ViceInodeInfo * info,
47 VolumeId vid, void *rock),
48 VolumeId singleVolumeNumber, void *rock);
49 int ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
50 int (*judgeInode) (struct ViceInodeInfo * info, VolumeId vid,
51 void *rock),
52 VolumeId singleVolumeNumber, int *forcep, int forceR,
53 char *wpath, void *rock);
54
55 #define NAMEI_LCOMP_LEN 32
56 #define NAMEI_PATH_LEN 256
57
58 #ifdef AFS_NT40_ENV
59 #define NAMEI_DRIVE_LEN 3
60 #define NAMEI_HASH_LEN 2
61 #define NAMEI_COMP_LEN 18
62 typedef struct {
63 char n_drive[NAMEI_DRIVE_LEN];
64 char n_voldir[NAMEI_COMP_LEN];
65 char n_dir[NAMEI_HASH_LEN];
66 char n_inode[NAMEI_COMP_LEN];
67 char n_path[NAMEI_PATH_LEN];
68 } namei_t;
69 #else
70 #define NAMEI_SCOMP_LEN 12
71 typedef struct {
72 char n_base[NAMEI_LCOMP_LEN];
73 char n_voldir1[NAMEI_SCOMP_LEN];
74 char n_voldir2[NAMEI_LCOMP_LEN];
75 char n_dir1[NAMEI_SCOMP_LEN];
76 char n_dir2[NAMEI_SCOMP_LEN];
77 char n_inode[NAMEI_LCOMP_LEN];
78 char n_path[NAMEI_PATH_LEN];
79 } namei_t;
80 #endif
81
82 void namei_HandleToName(namei_t * name, IHandle_t * h);
83 int namei_ConvertROtoRWvolume(char *pname, VolumeId volumeId);
84 int namei_replace_file_by_hardlink(IHandle_t *hLink, IHandle_t *hTarget);
85
86 # ifdef AFS_SALSRV_ENV
87 # include <afs/work_queue.h>
88 extern void namei_SetWorkQueue(struct afs_work_queue *wq);
89 # endif
90
91 #endif /* AFS_NAMEI_ENV */
92
93 #endif /* _AFS_NAMEI_OPS_H_H_ */