exofs: Add offset/length to exofs_get_io_state
[deliverable/linux.git] / fs / exofs / exofs.h
index c965806c2821c0900b05f17bb450210c655525e5..fd913ddfd48b505bd3208877ccfc7c0d03fc3d2e 100644 (file)
 #include <linux/fs.h>
 #include <linux/time.h>
 #include <linux/backing-dev.h>
+#include <linux/pnfs_osd_xdr.h>
 #include "common.h"
 
-/* FIXME: Remove once pnfs hits mainline
- * #include <linux/exportfs/pnfs_osd_xdr.h>
- */
-#include "pnfs.h"
-
 #define EXOFS_ERR(fmt, a...) printk(KERN_ERR "exofs: " fmt, ##a)
 
 #ifdef CONFIG_EXOFS_DEBUG
@@ -70,13 +66,14 @@ struct exofs_layout {
        enum exofs_inode_layout_gen_functions lay_func;
 
        unsigned        s_numdevs;              /* Num of devices in array    */
-       struct osd_dev  *s_ods[0];              /* Variable length            */
+       struct osd_dev  **s_ods;                /* osd_dev array              */
 };
 
 /*
  * our extension to the in-memory superblock
  */
 struct exofs_sb_info {
+       struct backing_dev_info bdi;            /* register our bdi with VFS  */
        struct exofs_sb_stats s_ess;            /* Written often, pre-allocate*/
        int             s_timeout;              /* timeout for OSD operations */
        uint64_t        s_nextid;               /* highest object ID used     */
@@ -85,15 +82,11 @@ struct exofs_sb_info {
        u32             s_next_generation;      /* next gen # to use          */
        atomic_t        s_curr_pending;         /* number of pending commands */
        uint8_t         s_cred[OSD_CAP_LEN];    /* credential for the fscb    */
-       struct          backing_dev_info bdi;   /* register our bdi with VFS  */
 
        struct pnfs_osd_data_map data_map;      /* Default raid to use
                                                 * FIXME: Needed ?
                                                 */
-/*     struct exofs_layout     dir_layout;*/   /* Default dir layout */
-       struct exofs_layout     layout;         /* Default files layout,
-                                                * contains the variable osd_dev
-                                                * array. Keep last */
+       struct exofs_layout     layout;         /* Default files layout       */
        struct osd_dev  *_min_one_dev[1];       /* Place holder for one dev   */
 };
 
@@ -116,7 +109,7 @@ static inline osd_id exofs_oi_objno(struct exofs_i_info *oi)
 }
 
 struct exofs_io_state;
-typedef void (*exofs_io_done_fn)(struct exofs_io_state *or, void *private);
+typedef void (*exofs_io_done_fn)(struct exofs_io_state *ios, void *private);
 
 struct exofs_io_state {
        struct kref             kref;
@@ -144,6 +137,8 @@ struct exofs_io_state {
        unsigned                out_attr_len;
        struct osd_attr         *out_attr;
 
+       bool                    reading;
+
        /* Variable array of size numdevs */
        unsigned numdevs;
        struct exofs_per_dev_state {
@@ -225,6 +220,8 @@ void exofs_make_credential(u8 cred_a[OSD_CAP_LEN],
 int exofs_read_kern(struct osd_dev *od, u8 *cred, struct osd_obj_id *obj,
                    u64 offset, void *p, unsigned length);
 
+int  exofs_get_rw_state(struct exofs_layout *layout, bool is_reading,
+                       u64 offset, u64 length, struct exofs_io_state **ios);
 int  exofs_get_io_state(struct exofs_layout *layout,
                        struct exofs_io_state **ios);
 void exofs_put_io_state(struct exofs_io_state *ios);
This page took 0.024987 seconds and 5 git commands to generate.