exofs: convert io_state to use pages array instead of bio at input
[safe/jmp/linux-2.6] / fs / exofs / exofs.h
index 13663da..acfebd3 100644 (file)
 /* u64 has problems with printk this will cast it to unsigned long long */
 #define _LLU(x) (unsigned long long)(x)
 
+struct exofs_layout {
+       osd_id          s_pid;                  /* partition ID of file system*/
+
+       /* Our way of looking at the data_map */
+       unsigned stripe_unit;
+       unsigned mirrors_p1;
+
+       unsigned group_width;
+
+       enum exofs_inode_layout_gen_functions lay_func;
+
+       unsigned        s_numdevs;              /* Num of devices in array    */
+       struct osd_dev  *s_ods[0];              /* Variable length            */
+};
+
 /*
  * our extension to the in-memory superblock
  */
 struct exofs_sb_info {
        struct exofs_fscb s_fscb;               /* Written often, pre-allocate*/
-       osd_id          s_pid;                  /* partition ID of file system*/
        int             s_timeout;              /* timeout for OSD operations */
        uint64_t        s_nextid;               /* highest object ID used     */
        uint32_t        s_numfiles;             /* number of files on fs      */
@@ -69,9 +83,14 @@ struct exofs_sb_info {
        atomic_t        s_curr_pending;         /* number of pending commands */
        uint8_t         s_cred[OSD_CAP_LEN];    /* credential for the fscb    */
 
-       struct pnfs_osd_data_map data_map;      /* Default raid to use        */
-       unsigned        s_numdevs;              /* Num of devices in array    */
-       struct osd_dev  *s_ods[1];              /* Variable length, minimum 1 */
+       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 osd_dev  *_min_one_dev[1];       /* Place holder for one dev   */
 };
 
 /*
@@ -101,7 +120,7 @@ struct exofs_io_state {
        void                    *private;
        exofs_io_done_fn        done;
 
-       struct exofs_sb_info    *sbi;
+       struct exofs_layout     *layout;
        struct osd_obj_id       obj;
        u8                      *cred;
 
@@ -109,7 +128,10 @@ struct exofs_io_state {
        loff_t                  offset;
        unsigned long           length;
        void                    *kern_buff;
-       struct bio              *bio;
+
+       struct page             **pages;
+       unsigned                nr_pages;
+       unsigned                pgbase;
 
        /* Attributes */
        unsigned                in_attr_len;
@@ -122,6 +144,9 @@ struct exofs_io_state {
        struct exofs_per_dev_state {
                struct osd_request *or;
                struct bio *bio;
+               loff_t offset;
+               unsigned length;
+               unsigned dev;
        } per_dev[];
 };
 
@@ -175,6 +200,12 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode)
 }
 
 /*
+ * Given a layout, object_number and stripe_index return the associated global
+ * dev_index
+ */
+unsigned exofs_layout_od_id(struct exofs_layout *layout,
+                           osd_id obj_no, unsigned layout_index);
+/*
  * Maximum count of links to a file
  */
 #define EXOFS_LINK_MAX           32000
@@ -189,7 +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_io_state(struct exofs_sb_info *sbi, 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);
 
 int exofs_check_io(struct exofs_io_state *ios, u64 *resid);