vol: remove empty directories left by vos zap -force
[openafs.git] / src / vol / namei_ops.h
index fff38a2..f3de432 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
 
 #ifdef AFS_NAMEI_ENV
 
-#ifdef notdef
-/* We don't include Unix afssyscalls.h, so: */
-#define VALID_INO(I) ((I != (__int64)-1) && (I != (__int64)0))
-
-/* minimum size of string to hand to PrintInode */
-#define AFS_INO_STR_LENGTH 32
-typedef char afs_ino_str_t[AFS_INO_STR_LENGTH];
-
-char *PrintInode(char *s, Inode ino);
-#endif
-
 /* Basic file operations */
-extern FILE *namei_fdopen(IHandle_t * h, char *fdperms);
+extern FD_t namei_fdopen(IHandle_t * h, char *fdperms);
 extern int namei_unlink(char *name);
 
 /* Inode operations */
-extern Inode namei_MakeSpecIno(int volid, int type);
-extern Inode namei_icreate(IHandle_t * h, char *p, int p1, int p2, int p3,
-                          int p4);
+extern Inode namei_MakeSpecIno(VolumeId volid, int type);
+extern Inode namei_icreate(IHandle_t * lh, char *part, afs_uint32 p1,
+                          afs_uint32 p2, afs_uint32 p3, afs_uint32 p4);
+extern IHandle_t *namei_icreate_init(IHandle_t *lh, int dev, char *part,
+                                     afs_uint32 p1, afs_uint32 p2,
+                                     afs_uint32 p3, afs_uint32 p4);
 extern FD_t namei_iopen(IHandle_t * h);
 extern int namei_irelease(IHandle_t * h);
 afs_sfsize_t namei_iread(IHandle_t * h, afs_foff_t offset, char *buf,
@@ -41,28 +33,41 @@ afs_sfsize_t namei_iwrite(IHandle_t * h, afs_foff_t offset, char *buf,
                          afs_fsize_t size);
 extern int namei_dec(IHandle_t * h, Inode ino, int p1);
 extern int namei_inc(IHandle_t * h, Inode ino, int p1);
-extern int namei_GetLinkCount(FdHandle_t * h, Inode ino, int lockit);
+extern int namei_GetLinkCount(FdHandle_t * h, Inode ino, int lockit, int fixup, int nowrite);
 extern int namei_SetLinkCount(FdHandle_t * h, Inode ino, int count, int locked);
 extern int namei_ViceREADME(char *partition);
+extern int namei_FixSpecialOGM(FdHandle_t *h, int check);
 #include "nfs.h"
 #include "viceinode.h"
 int namei_ListAFSFiles(char *dev,
-                      int (*write_fun) (FILE * fp,
+                      int (*write_fun) (FD_t fp,
                                         struct ViceInodeInfo * info,
-                                        char *dir, char *file), FILE * fp,
+                                        char *dir, char *file), FD_t fp,
                       int (*judge_fun) (struct ViceInodeInfo * info,
-                                        afs_uint32 vid, void *rock), 
-                      afs_uint32 singleVolumeNumber, void *rock);
-int ListViceInodes(char *devname, char *mountedOn, char *resultFile,
-                  int (*judgeInode) (struct ViceInodeInfo * info, afs_uint32 vid, 
+                                        VolumeId vid, void *rock),
+                      VolumeId singleVolumeNumber, void *rock);
+int ListViceInodes(char *devname, char *mountedOn, FD_t inodeFile,
+                  int (*judgeInode) (struct ViceInodeInfo * info, VolumeId vid,
                                      void *rock),
-                  afs_uint32 singleVolumeNumber, int *forcep, int forceR,
+                  VolumeId singleVolumeNumber, int *forcep, int forceR,
                   char *wpath, void *rock);
 
-
 #define NAMEI_LCOMP_LEN 32
-#define NAMEI_SCOMP_LEN 12
 #define NAMEI_PATH_LEN 256
+
+#ifdef AFS_NT40_ENV
+#define NAMEI_DRIVE_LEN 3
+#define NAMEI_HASH_LEN 2
+#define NAMEI_COMP_LEN 18
+typedef struct {
+    char n_drive[NAMEI_DRIVE_LEN];
+    char n_voldir[NAMEI_COMP_LEN];
+    char n_dir[NAMEI_HASH_LEN];
+    char n_inode[NAMEI_COMP_LEN];
+    char n_path[NAMEI_PATH_LEN];
+} namei_t;
+#else
+#define NAMEI_SCOMP_LEN 12
 typedef struct {
     char n_base[NAMEI_LCOMP_LEN];
     char n_voldir1[NAMEI_SCOMP_LEN];
@@ -72,11 +77,19 @@ typedef struct {
     char n_inode[NAMEI_LCOMP_LEN];
     char n_path[NAMEI_PATH_LEN];
 } namei_t;
+#endif
 
 void namei_HandleToName(namei_t * name, IHandle_t * h);
-int namei_ConvertROtoRWvolume(char *pname, afs_uint32 volumeId);
+int namei_ConvertROtoRWvolume(char *pname, VolumeId volumeId);
 int namei_replace_file_by_hardlink(IHandle_t *hLink, IHandle_t *hTarget);
 
+# ifdef AFS_SALSRV_ENV
+#  include <afs/work_queue.h>
+extern void namei_SetWorkQueue(struct afs_work_queue *wq);
+# endif
+
+int namei_RemoveDirectories(char *pname, afs_int32 vid);
+
 #endif /* AFS_NAMEI_ENV */
 
 #endif /* _AFS_NAMEI_OPS_H_H_ */