Whamcloud - gitweb
Replace all of the "char[37]" uses with obd_uuid_t.
[fs/lustre-release.git] / lustre / include / linux / lustre_lib.h
index 2b3ff7a..d3012a8 100644 (file)
 # include <string.h>
 #else
 # include <asm/semaphore.h>
+#include <linux/kp30.h> /* XXX just for LASSERT! */
 #endif
 #include <linux/portals_lib.h>
 #include <linux/lustre_idl.h>
 
+#if BITS_PER_LONG > 32
+#define LPU64 "%lu"
+#define LPD64 "%ld"
+#define LPX64 "%#lx"
+#else
+#define LPU64 "%Lu"
+#define LPD64 "%Ld"
+#define LPX64 "%#Lx"
+#endif
+
 #ifdef __KERNEL__
 /* l_net.c */
 struct ptlrpc_request;
 struct obd_device;
+struct recovd_data;
+
 int target_handle_connect(struct ptlrpc_request *req);
 int target_handle_disconnect(struct ptlrpc_request *req);
 int client_obd_connect(struct lustre_handle *conn, struct obd_device *obd,
-                       char *cluuid);
+                       obd_uuid_t cluuid);
 int client_obd_disconnect(struct lustre_handle *conn);
 int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf);
 int client_obd_cleanup(struct obd_device * obddev);
 struct client_obd *client_conn2cli(struct lustre_handle *conn); 
 
+int target_revoke_connection(struct recovd_data *rd, int phase);
+
 /* l_lock.c */
 struct lustre_lock { 
         int l_depth;
@@ -76,17 +91,12 @@ struct io_cb_data {
         int complete;
         int err;
         struct ptlrpc_bulk_desc *desc;
-        brw_callback_t    cb;
+        brw_callback_t cb;
+        void *data;
 };
 
 int ll_sync_io_cb(struct io_cb_data *data, int err, int phase);
 struct  io_cb_data *ll_init_cb(void);
-inline void lustre_put_page(struct page *page);
-struct page *lustre_get_page_read(struct inode *dir, unsigned long index);
-struct page *lustre_get_page_write(struct inode *dir, unsigned long index);
-int lustre_commit_write(struct page *page, unsigned from, unsigned to);
-void set_page_clean(struct page *page);
-void set_page_dirty(struct page *page);
 
 /* simple.c */
 struct obd_run_ctxt;
@@ -102,6 +112,7 @@ static inline void l_dput(struct dentry *de)
         if (!de || IS_ERR(de))
                 return;
         shrink_dcache_parent(de);
+        LASSERT(atomic_read(&de->d_count) > 0);
         dput(de);
 }
 
@@ -128,8 +139,14 @@ static inline void ldlm_object2handle(void *object, struct lustre_handle *handle
 
 struct obd_statfs;
 struct statfs;
-void obd_statfs_pack(struct obd_statfs *osfs, struct statfs *sfs);
-void obd_statfs_unpack(struct obd_statfs *osfs, struct statfs *sfs);
+void statfs_pack(struct obd_statfs *osfs, struct statfs *sfs);
+void statfs_unpack(struct statfs *sfs, struct obd_statfs *osfs);
+void obd_statfs_pack(struct obd_statfs *tgt, struct obd_statfs *src);
+static inline void
+obd_statfs_unpack(struct obd_statfs *tgt, struct obd_statfs *src)
+{
+        obd_statfs_pack(tgt, src);
+}
 
 #include <linux/portals_lib.h>
 
@@ -413,6 +430,9 @@ static inline int obd_ioctl_getdata(char **buf, int *len, void *arg)
 
 #define OBD_IOC_DEC_FS_USE_COUNT       _IO  ('f', 133      )
 
+#define OBD_IOC_OPEN                   _IOWR('f', 134, long)
+#define OBD_IOC_CLOSE                  _IOWR('f', 135, long)
+
 /*
  * l_wait_event is a flexible sleeping function, permitting simple caller
  * configuration of interrupt and timeout sensitivity along with actions to