Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ecryptfs...
[pandora-kernel.git] / fs / exofs / exofs.h
index 13663da..8442e35 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;
+       u64      group_depth;
+       unsigned group_count;
+
+       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 +85,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 +122,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 +130,11 @@ struct exofs_io_state {
        loff_t                  offset;
        unsigned long           length;
        void                    *kern_buff;
-       struct bio              *bio;
+
+       struct page             **pages;
+       unsigned                nr_pages;
+       unsigned                pgbase;
+       unsigned                pages_consumed;
 
        /* Attributes */
        unsigned                in_attr_len;
@@ -122,6 +147,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[];
 };
 
@@ -174,6 +202,12 @@ static inline struct exofs_i_info *exofs_i(struct inode *inode)
        return container_of(inode, struct exofs_i_info, vfs_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
  */
@@ -189,7 +223,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);
@@ -226,7 +261,7 @@ int exofs_write_begin(struct file *file, struct address_space *mapping,
                struct page **pagep, void **fsdata);
 extern struct inode *exofs_iget(struct super_block *, unsigned long);
 struct inode *exofs_new_inode(struct inode *, int);
-extern int exofs_write_inode(struct inode *, int);
+extern int exofs_write_inode(struct inode *, struct writeback_control *wbc);
 extern void exofs_delete_inode(struct inode *);
 
 /* dir.c:                */