Whamcloud - gitweb
- unland b_fid to HEAD
[fs/lustre-release.git] / lustre / obdfilter / filter_internal.h
index 6203418..12ad087 100644 (file)
@@ -16,8 +16,6 @@
 #include <linux/lustre_handles.h>
 #include <linux/obd.h>
 
-#define FILTER_LAYOUT_VERSION "2"
-
 #ifndef OBD_FILTER_DEVICENAME
 # define OBD_FILTER_DEVICENAME "obdfilter"
 #endif
@@ -38,9 +36,6 @@
 #define FILTER_LR_MAX_CLIENTS (PAGE_SIZE * 8)
 #define FILTER_LR_MAX_CLIENT_WORDS (FILTER_LR_MAX_CLIENTS/sizeof(unsigned long))
 
-#define FILTER_SUBDIR_COUNT      32            /* set to zero for no subdirs */
-#define FILTER_GROUPS 3 /* must be at least 3; not dynamic yet */
-
 #define FILTER_RECOVERY_TIMEOUT (obd_timeout * 5 * HZ / 2) /* *waves hands* */
 
 #define FILTER_ROCOMPAT_SUPP   (0)
@@ -75,7 +70,8 @@ struct filter_client_data {
         __u8  fcd_uuid[40];        /* client UUID */
         __u64 fcd_last_rcvd;       /* last completed transaction ID */
         __u64 fcd_last_xid;        /* client RPC xid for the last transaction */
-        __u8  fcd_padding[FILTER_LR_CLIENT_SIZE - 56];
+        __u32 fcd_group;           /* client group num*/
+        __u8  fcd_padding[FILTER_LR_CLIENT_SIZE - 60];
 };
 
 #define FILTER_DENTRY_MAGIC 0x9efba101
@@ -92,7 +88,7 @@ enum {
         LPROC_FILTER_LAST,
 };
 
-#define FILTER_MAX_CACHE_SIZE OBD_OBJECT_EOF
+#define FILTER_MAX_CACHE_SIZE (32 * 1024 * 1024) /* was OBD_OBJECT_EOF */
 
 /* filter.c */
 void f_dput(struct dentry *);
@@ -103,8 +99,8 @@ struct dentry *__filter_oa2dentry(struct obd_device *obd, struct obdo *oa,
 #define filter_oa2dentry(obd, oa) __filter_oa2dentry(obd, oa, __FUNCTION__)
 
 int filter_finish_transno(struct obd_export *, struct obd_trans_info *, int rc);
-__u64 filter_next_id(struct filter_obd *, struct obdo *);
-__u64 filter_last_id(struct filter_obd *, struct obdo *);
+__u64 filter_next_id(struct filter_obd *, int group);
+__u64 filter_last_id(struct filter_obd *, int group);
 int filter_update_server_data(struct obd_device *, struct file *,
                               struct filter_server_data *, int force_sync);
 int filter_update_last_objid(struct obd_device *, obd_gr, int force_sync);
@@ -122,11 +118,19 @@ int filter_preprw(int cmd, struct obd_export *, struct obdo *, int objcount,
 int filter_commitrw(int cmd, struct obd_export *, struct obdo *, int objcount,
                     struct obd_ioobj *, int niocount, struct niobuf_local *,
                     struct obd_trans_info *, int rc);
+int filter_write_extents(struct obd_export *exp, struct obd_ioobj *obj,
+                         int objcount, int niocount,struct niobuf_local *local, 
+                         int rc);
+int filter_do_cow(struct obd_export *exp, struct obd_ioobj *obj,
+                  int nioo, struct niobuf_remote *rnb);
 int filter_brw(int cmd, struct obd_export *, struct obdo *,
               struct lov_stripe_md *, obd_count oa_bufs, struct brw_page *,
               struct obd_trans_info *);
 void flip_into_page_cache(struct inode *inode, struct page *new_page);
 
+void filter_free_dio_pages(int objcount, struct obd_ioobj *obj,
+                           int niocount, struct niobuf_local *res);
+
 /* filter_io_*.c */
 int filter_commitrw_write(struct obd_export *exp, struct obdo *oa, int objcount,
                           struct obd_ioobj *obj, int niocount,
@@ -138,6 +142,14 @@ long filter_grant(struct obd_export *exp, obd_size current_grant,
 void filter_grant_commit(struct obd_export *exp, int niocount,
                          struct niobuf_local *res);
 
+int filter_alloc_iobuf(int rw, int num_pages, void **ret);
+void filter_free_iobuf(void *iobuf);
+int filter_iobuf_add_page(struct obd_device *obd, void *iobuf,
+                          struct inode *inode, struct page *page);
+int filter_direct_io(int rw, struct dentry *dchild, void *iobuf,
+                     struct obd_export *exp, struct iattr *attr,
+                     struct obd_trans_info *oti, void **wait_handle);
+
 /* filter_log.c */
 struct ost_filterdata {
         __u32  ofd_epoch;