Whamcloud - gitweb
Make the MDS filesystem interface code be a separate module. This allows
[fs/lustre-release.git] / lustre / include / linux / lustre_idl.h
index 1c9890f..d517c34 100644 (file)
 
 #ifndef __LUSTRE_IDL_H__
 #define __LUSTRE_IDL_H__
-#ifdef __KERNEL__
-#include <linux/ioctl.h>
-#include <asm/types.h>
 
-#include <linux/types.h>
+#ifdef __KERNEL__
+# include <linux/ioctl.h>
+# include <asm/types.h>
+# include <linux/types.h>
 #else
-#define __KERNEL__
-#include <linux/list.h>
-#undef __KERNEL__
-#include <stdint.h>
+# define __KERNEL__
+# include <linux/list.h>
+# undef __KERNEL__
+# include <stdint.h>
 #endif
 /*
  * this file contains all data structures used in Lustre interfaces:
@@ -61,6 +61,21 @@ struct lustre_msg {
         __u32   buflens[0];
 };
 
+struct niobuf_remote {
+        __u64 offset;
+        __u32 len;
+        __u32 xid;
+        __u32 flags;
+};
+
+struct niobuf_local {
+        __u64 addr;
+        __u64 offset;
+        __u32 len;
+        __u32 xid;
+        void *page;
+};
+
 /*
  *   OST requests: OBDO & OBD request records
  */
@@ -122,26 +137,28 @@ struct obdo {
         struct obd_ops          *o_op;
 };
 
-#define OBD_MD_FLALL    (~0UL)
-#define OBD_MD_FLID     (0x00000001UL)
-#define OBD_MD_FLATIME  (0x00000002UL)
-#define OBD_MD_FLMTIME  (0x00000004UL)
-#define OBD_MD_FLCTIME  (0x00000008UL)
-#define OBD_MD_FLSIZE   (0x00000010UL)
-#define OBD_MD_FLBLOCKS (0x00000020UL)
-#define OBD_MD_FLBLKSZ  (0x00000040UL)
-#define OBD_MD_FLMODE   (0x00000080UL)
-#define OBD_MD_FLTYPE   (0x00000100UL)
-#define OBD_MD_FLUID    (0x00000200UL)
-#define OBD_MD_FLGID    (0x00000400UL)
-#define OBD_MD_FLFLAGS  (0x00000800UL)
-#define OBD_MD_FLOBDFLG (0x00001000UL)
-#define OBD_MD_FLNLINK  (0x00002000UL)
-#define OBD_MD_FLGENER  (0x00004000UL)
-#define OBD_MD_FLINLINE (0x00008000UL)
-#define OBD_MD_FLOBDMD  (0x00010000UL)
-#define OBD_MD_FLOBJID  (0x00020000UL)
-#define OBD_MD_FLNOTOBD (~(OBD_MD_FLOBDMD | OBD_MD_FLOBDFLG | OBD_MD_FLBLOCKS))
+#define OBD_MD_FLALL    0xffffffff
+#define OBD_MD_FLID     (0x00000001)
+#define OBD_MD_FLATIME  (0x00000002)
+#define OBD_MD_FLMTIME  (0x00000004)
+#define OBD_MD_FLCTIME  (0x00000008)
+#define OBD_MD_FLSIZE   (0x00000010)
+#define OBD_MD_FLBLOCKS (0x00000020)
+#define OBD_MD_FLBLKSZ  (0x00000040)
+#define OBD_MD_FLMODE   (0x00000080)
+#define OBD_MD_FLTYPE   (0x00000100)
+#define OBD_MD_FLUID    (0x00000200)
+#define OBD_MD_FLGID    (0x00000400)
+#define OBD_MD_FLFLAGS  (0x00000800)
+#define OBD_MD_FLOBDFLG (0x00001000)
+#define OBD_MD_FLNLINK  (0x00002000)
+#define OBD_MD_FLGENER  (0x00004000)
+#define OBD_MD_FLINLINE (0x00008000)
+#define OBD_MD_FLOBDMD  (0x00010000)
+#define OBD_MD_FLOBJID  (0x00020000)
+#define OBD_MD_LINKNAME (0x00040000)
+#define OBD_MD_FLNOTOBD (~(OBD_MD_FLOBDMD | OBD_MD_FLOBDFLG | OBD_MD_FLBLOCKS |\
+                           OBD_MD_LINKNAME))
 
 /* request structure for OST's */
 
@@ -165,19 +182,20 @@ struct obd_ioobj {
  */
 
 /* opcodes */
-#define MDS_GETATTR   1
-#define MDS_OPEN      2
-#define MDS_CLOSE     3
-#define MDS_REINT     4
-#define MDS_READPAGE  5
-#define MDS_CONNECT   6
-
-#define REINT_SETATTR 1
-#define REINT_CREATE  2
-#define REINT_LINK    3
-#define REINT_UNLINK  4
-#define REINT_RENAME  5
-#define REINT_MAX     5
+#define MDS_GETATTR    1
+#define MDS_OPEN       2
+#define MDS_CLOSE      3
+#define MDS_REINT      4
+#define MDS_READPAGE   6
+#define MDS_CONNECT    7
+
+#define REINT_SETATTR  1
+#define REINT_CREATE   2
+#define REINT_LINK     3
+#define REINT_UNLINK   4
+#define REINT_RENAME   5
+#define REINT_RECREATE 6
+#define REINT_MAX      6
 
 struct ll_fid {
         __u64 id;
@@ -185,15 +203,6 @@ struct ll_fid {
         __u32 f_type;
 };
 
-struct niobuf {
-        __u64 addr;
-        __u64 offset;
-        __u32 len;
-        __u32 flags;
-        __u32 xid;
-        void *page;
-};
-
 struct mds_body {
         struct ll_fid  fid1;
         struct ll_fid  fid2;
@@ -269,11 +278,10 @@ struct mds_rec_rename {
  */
 
 /* opcodes */
-#define LDLM_NAMESPACE_NEW 1
-#define LDLM_ENQUEUE       2
-#define LDLM_CONVERT       3
-#define LDLM_CANCEL        4
-#define LDLM_CALLBACK      5
+#define LDLM_ENQUEUE       1
+#define LDLM_CONVERT       2
+#define LDLM_CANCEL        3
+#define LDLM_CALLBACK      4
 
 #define RES_NAME_SIZE 3
 #define RES_VERSION_SIZE 4
@@ -299,7 +307,6 @@ struct ldlm_extent {
 };
 
 struct ldlm_resource_desc {
-        __u32 lr_ns_id;
         __u32 lr_type;
         __u64 lr_name[RES_NAME_SIZE];
         __u64 lr_version[RES_VERSION_SIZE];