vos: vos release -force-reclone option
[openafs.git] / src / volser / volser.p.h
index d9787f0..899c824 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
@@ -11,7 +11,6 @@
 #define _VOLSER_ 1
 
 #ifdef AFS_PTHREAD_ENV
-#include <assert.h>
 #include <pthread.h>
 #endif
 
@@ -36,6 +35,7 @@
 #define volser_RW      0
 #define volser_RO      1
 #define        volser_BACK     2
+#define        volser_RWREPL   3
 
 #define        THOLD(tt)       ((tt)->refCount++)
 
@@ -46,7 +46,7 @@ struct volser_trans {
     afs_int32 creationTime;    /* time the transaction started */
     afs_int32 returnCode;      /* transaction error code */
     struct Volume *volume;     /* pointer to open volume */
-    afs_int32 volid;           /* open volume's id */
+    VolumeId volid;            /* open volume's id */
     afs_int32 partition;       /* open volume's partition */
     afs_int32 dumpTransId;     /* other side's trans id during a dump */
     afs_int32 dumpSeq;         /* next sequence number to use during a dump */
@@ -58,19 +58,32 @@ struct volser_trans {
     /* the fields below are useful for debugging */
     char lastProcName[30];     /* name of the last procedure which used transaction */
     struct rx_call *rxCallPtr; /* pointer to latest associated rx_call */
+#ifdef AFS_PTHREAD_ENV
+    pthread_mutex_t lock;       /* per transaction lock */
+#endif
 
 };
 
-/* This is how often the garbage collection thread wakes up and 
+/* This is how often the garbage collection thread wakes up and
  * checks for transactions that have timed out: BKGLoop()
  */
 #define GCWAKEUP            30
 
-struct volser_dest {
-    afs_int32 destHost;
-    afs_int32 destPort;
-    afs_int32 destSSID;
-};
+#ifdef AFS_PTHREAD_ENV
+#define VTRANS_OBJ_LOCK_INIT(tt) \
+  opr_mutex_init(&((tt)->lock));
+#define VTRANS_OBJ_LOCK_DESTROY(tt) \
+  opr_mutex_destroy(&((tt)->lock))
+#define VTRANS_OBJ_LOCK(tt) \
+  opr_mutex_enter(&((tt)->lock))
+#define VTRANS_OBJ_UNLOCK(tt) \
+  opr_mutex_exit(&((tt)->lock))
+#else
+#define VTRANS_OBJ_LOCK_INIT(tt)
+#define VTRANS_OBJ_LOCK_DESTROY(tt)
+#define VTRANS_OBJ_LOCK(tt)
+#define VTRANS_OBJ_UNLOCK(tt)
+#endif /* AFS_PTHREAD_ENV */
 
 #define        MAXHELPERS          10
 /* flags for vol helper busyFlags array.  First, VHIdle goes on when a server
@@ -87,7 +100,7 @@ extern struct volser_trans *QI_GlobalWriteTrans;
 
 #define VSALVAGE       101     /* Volume needs salvage */
 #define VNOVNODE       102     /* Bad vnode number quoted */
-#define VNOVOL         103     /* Volume not attached, doesn't exist, 
+#define VNOVOL         103     /* Volume not attached, doesn't exist,
                                 * not created or not online */
 #define VVOLEXISTS     104     /* Volume already exists */
 #define VNOSERVICE     105     /* Volume is not in service (i.e. it's
@@ -105,8 +118,6 @@ extern struct volser_trans *QI_GlobalWriteTrans;
 #define VMOVED         111     /* Volume has moved to another server; do a VGetVolumeInfo
                                 * to THIS server to find out where */
 
-#define MyPort 5003
-#define NameLen 80
 #define VLDB_MAXSERVERS 10
 #define VOLSERVICE_ID 4
 #define INVALID_BID 0
@@ -142,6 +153,7 @@ struct partList {           /*used by the backup system */
 #define ITSROVOL    0x02
 #define ITSRWVOL    0x04
 #define ITSBACKVOL  0x08
+#define ITSRWREPL   0x10
 #define RO_DONTUSE  0x20
 
 #define VLOP_RESTORE 0x100     /*this is bogus, clashes with VLOP_DUMP */
@@ -171,11 +183,19 @@ struct partList {         /*used by the backup system */
 #define RV_NOVLDB      0x040000
 #define RV_NOCLONE     0x080000
 #define RV_NODEL        0x100000
+#define RV_RWONLY      0x200000
+
+/* Values for the UV_ReleaseVolume flags parameters */
+#define REL_COMPLETE    0x000001  /* force a complete release */
+#define REL_FULLDUMPS   0x000002  /* force full dumps */
+#define REL_STAYUP      0x000004  /* dump to clones to avoid offline time */
 
 struct ubik_client;
 extern afs_uint32 vsu_GetVolumeID(char *astring, struct ubik_client *acstruct, afs_int32 *errp);
 extern int vsu_ExtractName(char rname[], char name[]);
-extern afs_int32 vsu_ClientInit(int noAuthFlag, char *confDir, char *cellName, afs_int32 sauth, struct ubik_client **uclientp, int (*secproc)());
-extern void vsu_SetCrypt(int cryptflag);
-
+extern afs_int32 vsu_ClientInit(const char *confDir, char *cellName,
+                               int secFlags,
+                               int (*secproc)(struct rx_securityClass *,
+                                              afs_int32),
+                               struct ubik_client **uclientp);
 #endif /* _VOLSER_ */