Whamcloud - gitweb
Fixes and cleanups in lmv.
[fs/lustre-release.git] / lustre / include / linux / obd.h
index 2c5155e..417cce0 100644 (file)
@@ -18,7 +18,9 @@
 #define IOC_MDC_TYPE         'i'
 #define IOC_MDC_MIN_NR       20
 #define IOC_MDC_LOOKUP       _IOWR(IOC_MDC_TYPE, 20, struct obd_device *)
-#define IOC_MDC_GETSTRIPE    _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *)
+/* Moved to lustre_user.h
+#define IOC_MDC_GETSTRIPE    _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *) */
+#define IOC_MDC_FINISH_GNS   _IOWR(IOC_MDC_TYPE, 22, struct obd_device *)
 #define IOC_MDC_MAX_NR       50
 
 #ifdef __KERNEL__
@@ -31,6 +33,7 @@
 # include <linux/mount.h>
 #endif
 
+#include <linux/lvfs.h>
 #include <linux/lustre_lib.h>
 #include <linux/lustre_idl.h>
 #include <linux/lustre_export.h>
@@ -40,38 +43,49 @@ struct loi_oap_pages {
         struct list_head        lop_pending;
         int                     lop_num_pending;
         struct list_head        lop_urgent;
-        struct list_head        lop_pending_sync;
+        struct list_head        lop_pending_group;
 };
 
 struct lov_oinfo {                 /* per-stripe data structure */
         __u64 loi_id;              /* object ID on the target OST */
         __u64 loi_gr;              /* object group on the target OST */
-        struct lustre_handle *loi_handle; /* open file handle for obj on OST */
         int loi_ost_idx;           /* OST stripe index in lov_tgt_desc->tgts */
         int loi_ost_gen;           /* generation of this loi_ost_idx */
 
-        /* tracking offsets per file, per stripe.. */
+        /* used by the osc to keep track of what objects to build into rpcs */
         struct loi_oap_pages loi_read_lop;
         struct loi_oap_pages loi_write_lop;
+        /* _cli_ is poorly named, it should be _ready_ */
         struct list_head loi_cli_item;
+        struct list_head loi_write_item;
+        struct list_head loi_read_item;
+
+        int loi_kms_valid:1;
+        __u64 loi_kms;             /* known minimum size */
+        __u64 loi_rss;             /* recently seen size */
+        __u64 loi_mtime;           /* recently seen mtime */
+        __u64 loi_blocks;          /* recently seen blocks */
 };
 
 static inline void loi_init(struct lov_oinfo *loi)
 {
         INIT_LIST_HEAD(&loi->loi_read_lop.lop_pending);
         INIT_LIST_HEAD(&loi->loi_read_lop.lop_urgent);
-        INIT_LIST_HEAD(&loi->loi_read_lop.lop_pending_sync);
+        INIT_LIST_HEAD(&loi->loi_read_lop.lop_pending_group);
         INIT_LIST_HEAD(&loi->loi_write_lop.lop_pending);
         INIT_LIST_HEAD(&loi->loi_write_lop.lop_urgent);
-        INIT_LIST_HEAD(&loi->loi_write_lop.lop_pending_sync);
+        INIT_LIST_HEAD(&loi->loi_write_lop.lop_pending_group);
         INIT_LIST_HEAD(&loi->loi_cli_item);
+        INIT_LIST_HEAD(&loi->loi_write_item);
+        INIT_LIST_HEAD(&loi->loi_read_item);
 }
 
 struct lov_stripe_md {
         /* Public members. */
         __u64 lsm_object_id;        /* lov object id */
         __u64 lsm_object_gr;        /* lov object id */
-        __u64 lsm_maxbytes;
+        __u64 lsm_maxbytes;         /* maximum possible file size */
+        unsigned long lsm_xfersize; /* optimal transfer size */
 
         /* LOV-private members start here -- only for use in lov/. */
         __u32 lsm_magic;
@@ -84,6 +98,7 @@ struct lov_stripe_md {
 struct obd_type {
         struct list_head typ_chain;
         struct obd_ops *typ_ops;
+        struct md_ops *typ_md_ops;
         struct proc_dir_entry *typ_procroot;
         char *typ_name;
         int  typ_refcnt;
@@ -97,37 +112,84 @@ struct brw_page {
 };
 
 enum async_flags {
-        ASYNC_READY = 0x1,
+        ASYNC_READY = 0x1, /* ap_make_ready will not be called before this
+                              page is added to an rpc */
         ASYNC_URGENT = 0x2,
-        ASYNC_COUNT_STABLE = 0x4,
+        ASYNC_COUNT_STABLE = 0x4, /* ap_refresh_count will not be called
+                                     to give the caller a chance to update
+                                     or cancel the size of the io */
+        ASYNC_GROUP_SYNC = 0x8,  /* ap_completion will not be called, instead
+                                    the page is accounted for in the
+                                    obd_io_group given to 
+                                    obd_queue_group_io */
 };
 
 struct obd_async_page_ops {
         int  (*ap_make_ready)(void *data, int cmd);
         int  (*ap_refresh_count)(void *data, int cmd);
         void (*ap_fill_obdo)(void *data, int cmd, struct obdo *oa);
-        void (*ap_completion)(void *data, int cmd, int rc);
+        void (*ap_completion)(void *data, int cmd, struct obdo *oa, int rc);
 };
 
-struct obd_sync_io_container {
-        spinlock_t      osic_lock;
-        atomic_t        osic_refcount;
-        int             osic_pending;
-        int             osic_rc;
-        wait_queue_head_t osic_waitq;
+/* the `oig' is passed down from a caller of obd rw methods.  the callee
+ * records enough state such that the caller can sleep on the oig and
+ * be woken when all the callees have finished their work */
+struct obd_io_group {
+        spinlock_t      oig_lock;
+        atomic_t        oig_refcount;
+        int             oig_pending;
+        int             oig_rc;
+        struct list_head oig_occ_list;
+        wait_queue_head_t oig_waitq;
 };
 
-/* Individual type definitions */
+/* the oig callback context lets the callee of obd rw methods register
+ * for callbacks from the caller. */
+struct oig_callback_context {
+        struct list_head occ_oig_item;
+        /* called when the caller has received a signal while sleeping.
+         * callees of this method are encouraged to abort their state 
+         * in the oig.  This may be called multiple times. */
+        void (*occ_interrupted)(struct oig_callback_context *occ);
+};
+
+/* if we find more consumers this could be generalized */
+#define OBD_HIST_MAX 32
+struct obd_histogram {
+        spinlock_t      oh_lock;
+        unsigned long   oh_buckets[OBD_HIST_MAX];
+};
 
 struct ost_server_data;
 
+#define FILTER_SUBDIR_COUNT      32            /* set to zero for no subdirs */
+
+#define FILTER_GROUP_LLOG 1
+#define FILTER_GROUP_ECHO 2
+#define FILTER_GROUP_FIRST_MDS 3
+
+struct filter_subdirs {
+        struct dentry *dentry[FILTER_SUBDIR_COUNT];
+};
+
+struct filter_group_llog {
+        struct list_head list;
+        int group;
+        struct obd_llogs *llogs;
+};
+
 struct filter_obd {
         const char          *fo_fstype;
         struct super_block  *fo_sb;
         struct vfsmount     *fo_vfsmnt;
-        struct dentry       *fo_dentry_O;
-        struct dentry      **fo_dentry_O_groups;
-        struct dentry      **fo_dentry_O_sub;
+
+        int                    fo_group_count;
+        struct dentry         *fo_dentry_O; /* the "O"bject directory dentry */
+        struct dentry         **fo_groups;   /* dentries for each group dir */
+        struct filter_subdirs *fo_subdirs;  /* subdir array per group */
+        __u64                 *fo_last_objids; // per-group last created objid
+        struct file          **fo_last_objid_files;
+
         spinlock_t           fo_objidlock; /* protect fo_lastobjid increment */
         spinlock_t           fo_translock; /* protect fsd_last_rcvd increment */
         struct file         *fo_rcvd_filp;
@@ -135,36 +197,45 @@ struct filter_obd {
         unsigned long       *fo_last_rcvd_slots;
         __u64                fo_mount_count;
 
+        unsigned int         fo_destroy_in_progress:1;
+        struct semaphore     fo_create_lock;
+
         struct file_operations *fo_fop;
         struct inode_operations *fo_iop;
         struct address_space_operations *fo_aops;
 
         struct list_head     fo_export_list;
         int                  fo_subdir_count;
-        spinlock_t           fo_grant_lock;       /* protects tot_granted */
-        obd_size             fo_tot_granted;
-        obd_size             fo_tot_cached;
+
+        obd_size             fo_tot_dirty;      /* protected by obd_osfs_lock */
+        obd_size             fo_tot_granted;    /* all values in bytes */
+        obd_size             fo_tot_pending;
+
+        obd_size             fo_readcache_max_filesize;
 
         struct obd_import   *fo_mdc_imp;
         struct obd_uuid      fo_mdc_uuid;
         struct lustre_handle fo_mdc_conn;
-#if 0
-        struct ptlrpc_client fo_mdc_client;
-#endif
-        struct file        **fo_last_objid_files;
-        __u64               *fo_last_objids; //last created object ID for groups
 
         struct semaphore     fo_alloc_lock;
+
+        struct obd_histogram     fo_r_pages;
+        struct obd_histogram     fo_w_pages;
+        struct obd_histogram     fo_r_discont_pages;
+        struct obd_histogram     fo_w_discont_pages;
+        struct obd_histogram     fo_r_discont_blocks;
+        struct obd_histogram     fo_w_discont_blocks;
+
+        struct list_head         fo_llog_list;
+        spinlock_t               fo_llog_list_lock;
 };
 
 struct mds_server_data;
 
-/* if we find more consumers this could be generalized */
-#define OSC_HIST_MAX 32
-struct osc_histogram {
-        spinlock_t      oh_lock;
-        unsigned long   oh_buckets[OSC_HIST_MAX];
-};
+#define OSC_MAX_RIF_DEFAULT       4
+#define OSC_MAX_RIF_MAX          32
+#define OSC_MAX_DIRTY_DEFAULT     4
+#define OSC_MAX_DIRTY_MB_MAX    256     /* totally arbitrary */
 
 struct mdc_rpc_lock;
 struct client_obd {
@@ -180,37 +251,36 @@ struct client_obd {
         //struct llog_canceld_ctxt *cl_llcd; /* it's included by obd_llog_ctxt */
         void                    *cl_llcd_offset;
 
-        struct semaphore         cl_dirty_sem;
-        obd_size                 cl_dirty;  /* all _dirty_ in bytes */
-        obd_size                 cl_dirty_granted; /* from ost */
-        obd_size                 cl_dirty_max; /* allowed w/o rpc */
-        struct list_head         cl_cache_waiters;
-
         struct obd_device       *cl_mgmtcli_obd;
 
-        /* this is just to keep existing infinitely caching behaviour between
-         * clients and OSTs that don't have the grant code in yet.. it can
-         * be yanked once everything speaks grants */
-        char                     cl_ost_can_grant;
+        /* the grant values are protected by loi_list_lock below */
+        long                     cl_dirty;         /* all _dirty_ in bytes */
+        long                     cl_dirty_max;     /* allowed w/o rpc */
+        long                     cl_avail_grant;   /* bytes of credit for ost */
+        long                     cl_lost_grant;    /* lost credits (trunc) */
+        struct list_head         cl_cache_waiters; /* waiting for cache/grant */
 
         /* keep track of objects that have lois that contain pages which
          * have been queued for async brw.  this lock also protects the
-         * lists of obd_client_pages that hang off of the loi */
+         * lists of osc_client_pages that hang off of the loi */
         spinlock_t               cl_loi_list_lock;
         struct list_head         cl_loi_ready_list;
+        struct list_head         cl_loi_write_list;
+        struct list_head         cl_loi_read_list;
         int                      cl_brw_in_flight;
         /* just a sum of the loi/lop pending numbers to be exported by /proc */
         int                      cl_pending_w_pages;
         int                      cl_pending_r_pages;
         int                      cl_max_pages_per_rpc;
         int                      cl_max_rpcs_in_flight;
-        struct osc_histogram     cl_read_rpc_hist;
-        struct osc_histogram     cl_write_rpc_hist;
-        struct osc_histogram     cl_read_page_hist;
-        struct osc_histogram     cl_write_page_hist;
+        struct obd_histogram     cl_read_rpc_hist;
+        struct obd_histogram     cl_write_rpc_hist;
+        struct obd_histogram     cl_read_page_hist;
+        struct obd_histogram     cl_write_page_hist;
 
         struct mdc_rpc_lock     *cl_rpc_lock;
         struct mdc_rpc_lock     *cl_setattr_lock;
+        struct osc_creator      cl_oscc;
 };
 
 /* Like a client, with some hangers-on.  Keep mc_client_obd first so that we
@@ -246,7 +316,7 @@ struct mds_obd {
         struct dentry                   *mds_logs_dir;
         struct dentry                   *mds_objects_dir;
         struct llog_handle              *mds_cfg_llh;
-//        struct llog_handle              *mds_catalog;
+//      struct llog_handle              *mds_catalog;
         struct obd_device               *mds_osc_obd; /* XXX lov_obd */
         struct obd_uuid                  mds_lov_uuid;
         char                            *mds_profile;
@@ -259,8 +329,18 @@ struct mds_obd {
         struct file                     *mds_lov_objid_filp;
         unsigned long                   *mds_client_bitmap;
         struct semaphore                 mds_orphan_recovery_sem;
-
+        /*add mds num here for real mds and cache mds create
+          FIXME later will be totally fixed by b_cmd*/
+        int                              mds_num;
         atomic_t                         mds_open_count;
+
+        char                            *mds_lmv_name;
+        struct obd_device               *mds_lmv_obd; /* XXX lmv_obd */
+        struct obd_export               *mds_lmv_exp; /* XXX lov_exp */
+        struct ptlrpc_service           *mds_create_service;
+        atomic_t                         mds_real_clients;
+        struct obd_uuid                  mds_lmv_uuid;
+        struct dentry                   *mds_fids_dir;
 };
 
 struct echo_obd {
@@ -318,8 +398,10 @@ struct echo_client_obd {
 };
 
 struct cache_obd {
-        struct obd_export *cobd_target_exp;/* local connection to target obd */
+        struct obd_export *cobd_real_exp;/* local connection to target obd */
         struct obd_export *cobd_cache_exp; /* local connection to cache obd */
+        int    refcount;
+        int    cache_on;
 };
 
 struct lov_tgt_desc {
@@ -337,16 +419,45 @@ struct lov_obd {
         struct lov_tgt_desc *tgts;
 };
 
+struct lmv_tgt_desc {
+        struct obd_uuid         uuid;
+        struct obd_export       *ltd_exp;
+        int                      active; /* is this target up for requests */
+};
+
+struct lmv_obd {
+        spinlock_t              lmv_lock;
+        struct lmv_desc         desc;
+        int                     bufsize;
+        int                     refcount;
+        struct lmv_tgt_desc     *tgts;
+        struct obd_uuid         cluuid;
+        struct obd_export       *exp;
+        int                     connected;
+        int                     max_easize;
+        int                     max_cookiesize;
+        int                     server_timeout;
+};
+
 struct niobuf_local {
         __u64 offset;
         __u32 len;
         __u32 flags;
-        int rc;
         struct page *page;
         struct dentry *dentry;
-        unsigned long start;
+        int lnb_grant_used;
+        int rc;
 };
 
+struct cache_manager_obd {
+        struct obd_device *cm_master_obd;       /* master lov */
+        struct obd_export *cm_master_exp;
+        struct obd_device *cm_cache_obd;        /* cache obdfilter */
+        struct obd_export *cm_cache_exp;
+        int    cm_master_group;                 /* master group*/        
+        struct cmobd_write_service   *cm_write_srv;
+};
+        
 
 /* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */
 #define N_LOCAL_TEMP_PAGE 0x10000000
@@ -407,9 +518,13 @@ enum llog_ctxt_id {
         LLOG_RD1_REPL_CTXT    =  9,
         LLOG_TEST_ORIG_CTXT   = 10,
         LLOG_TEST_REPL_CTXT   = 11,
+        LLOG_REINT_ORIG_CTXT  = 12,
         LLOG_MAX_CTXTS
 };
 
+struct obd_llogs {
+        struct llog_ctxt        *llog_ctxt[LLOG_MAX_CTXTS];
+};
 
 /* corresponds to one of the obd's */
 struct obd_device {
@@ -420,9 +535,9 @@ struct obd_device {
         struct obd_uuid obd_uuid;
 
         int obd_minor;
-        int obd_attached:1, obd_set_up:1, obd_recovering:1,
-            obd_abort_recovery:1, obd_replayable:1, obd_no_transno:1,
-            obd_no_recov:1, obd_stopping:1;
+        unsigned int obd_attached:1, obd_set_up:1, obd_recovering:1,
+                obd_abort_recovery:1, obd_replayable:1, obd_no_transno:1,
+                obd_no_recov:1, obd_stopping:1;
         atomic_t obd_refcount;
         wait_queue_head_t obd_refcount_waitq;
         struct proc_dir_entry *obd_proc_entry;
@@ -434,10 +549,12 @@ struct obd_device {
         spinlock_t             obd_dev_lock;
         __u64                  obd_last_committed;
         struct fsfilt_operations *obd_fsops;
-        struct llog_ctxt        *obd_llog_ctxt[LLOG_MAX_CTXTS];
+        spinlock_t              obd_osfs_lock;
         struct obd_statfs       obd_osfs;
         unsigned long           obd_osfs_age;
-        struct obd_run_ctxt     obd_ctxt;
+        struct lvfs_run_ctxt    obd_lvfs_ctxt;
+        struct obd_llogs        obd_llogs;
+        struct llog_ctxt        *obd_llog_ctxt[LLOG_MAX_CTXTS];
         struct obd_device       *obd_observer;
         struct obd_export       *obd_self_export;
 
@@ -452,7 +569,8 @@ struct obd_device {
         int                              obd_replayed_requests;
         int                              obd_requests_queued_for_recovery;
         wait_queue_head_t                obd_next_transno_waitq;
-        wait_queue_head_t                obd_commit_waitq;
+        struct list_head                 obd_uncommitted_replies;
+        spinlock_t                       obd_uncommitted_replies_lock;
         struct timer_list                obd_recovery_timer;
         struct list_head                 obd_recovery_queue;
         struct list_head                 obd_delayed_reply_queue;
@@ -469,6 +587,8 @@ struct obd_device {
                 struct cache_obd cobd;
                 struct ptlbd_obd ptlbd;
                 struct mgmtcli_obd mgmtcli;
+                struct lmv_obd lmv;
+                struct cache_manager_obd cmobd;
         } u;
        /* Fields used by LProcFS */
         unsigned int           obd_cntr_base;
@@ -479,9 +599,12 @@ struct obd_device {
 
 #define OBD_OPT_FORCE           0x0001
 #define OBD_OPT_FAILOVER        0x0002
+#define OBD_OPT_REAL_CLIENT     0x0004
 
 #define OBD_LLOG_FL_SENDNOW     0x0001
 
+struct mdc_op_data;
+
 struct obd_ops {
         struct module *o_owner;
         int (*o_iocontrol)(unsigned int cmd, struct obd_export *exp, int len,
@@ -493,7 +616,6 @@ struct obd_ops {
         int (*o_attach)(struct obd_device *dev, obd_count len, void *data);
         int (*o_detach)(struct obd_device *dev);
         int (*o_setup) (struct obd_device *dev, obd_count len, void *data);
-        int (*o_postsetup) (struct obd_device *dev);
         int (*o_precleanup)(struct obd_device *dev, int flags);
         int (*o_cleanup)(struct obd_device *dev, int flags);
         int (*o_postrecov)(struct obd_device *dev);
@@ -538,16 +660,16 @@ struct obd_ops {
                                 struct lov_oinfo *loi, void *cookie, 
                                 int cmd, obd_off off, int count, 
                                 obd_flag brw_flags, obd_flag async_flags);
-        int (*o_queue_sync_io)(struct obd_export *exp, 
-                               struct lov_stripe_md *lsm, 
-                               struct lov_oinfo *loi, 
-                               struct obd_sync_io_container *osic
-                               void *cookie, int cmd, obd_off off, int count, 
-                               obd_flag brw_flags);
-        int (*o_trigger_sync_io)(struct obd_export *exp, 
-                                 struct lov_stripe_md *lsm, 
-                                 struct lov_oinfo *loi, 
-                                 struct obd_sync_io_container *osic);
+        int (*o_queue_group_io)(struct obd_export *exp, 
+                                struct lov_stripe_md *lsm, 
+                                struct lov_oinfo *loi, 
+                                struct obd_io_group *oig
+                                void *cookie, int cmd, obd_off off, int count, 
+                                obd_flag brw_flags, obd_flag async_flags);
+        int (*o_trigger_group_io)(struct obd_export *exp, 
+                                  struct lov_stripe_md *lsm, 
+                                  struct lov_oinfo *loi, 
+                                  struct obd_io_group *oig);
         int (*o_set_async_flags)(struct obd_export *exp,
                                 struct lov_stripe_md *lsm,
                                 struct lov_oinfo *loi, void *cookie,
@@ -576,18 +698,19 @@ struct obd_ops {
         int (*o_commitrw)(int cmd, struct obd_export *exp, struct obdo *oa,
                           int objcount, struct obd_ioobj *obj,
                           int niocount, struct niobuf_local *local,
-                          struct obd_trans_info *oti);
-        int (*o_enqueue)(struct obd_export *exp, struct lov_stripe_md *md,
-                         struct lustre_handle *parent_lock,
-                         __u32 type, void *cookie, int cookielen, __u32 mode,
-                         int *flags, void *cb, void *data,
+                          struct obd_trans_info *oti, int rc);
+        int (*o_write_extents)(struct obd_export *exp, struct obd_ioobj *obj,
+                               int niocount, struct niobuf_local *local,int rc);
+        int (*o_enqueue)(struct obd_export *, struct lov_stripe_md *,
+                         __u32 type, ldlm_policy_data_t *, __u32 mode,
+                         int *flags, void *bl_cb, void *cp_cb, void *gl_cb,
+                         void *data, __u32 lvb_len, void *lvb_swabber,
                          struct lustre_handle *lockh);
-        int (*o_match)(struct obd_export *exp, struct lov_stripe_md *md,
-                         __u32 type, void *cookie, int cookielen, __u32 mode,
-                         int *flags, void *data, struct lustre_handle *lockh);
-        int (*o_change_cbdata)(struct obd_export *exp,
-                               struct lov_stripe_md *lsm, ldlm_iterator_t it,
-                               void *data);
+        int (*o_match)(struct obd_export *, struct lov_stripe_md *, __u32 type,
+                       ldlm_policy_data_t *, __u32 mode, int *flags, void *data,
+                       struct lustre_handle *lockh);
+        int (*o_change_cbdata)(struct obd_export *, struct lov_stripe_md *,
+                               ldlm_iterator_t it, void *data);
         int (*o_cancel)(struct obd_export *, struct lov_stripe_md *md,
                         __u32 mode, struct lustre_handle *);
         int (*o_cancel_unused)(struct obd_export *, struct lov_stripe_md *,
@@ -600,32 +723,100 @@ struct obd_ops {
         int (*o_destroy_export)(struct obd_export *exp);
 
         /* llog related obd_methods */
-        int (*o_llog_init)(struct obd_device *obd, struct obd_device *disk_obd,
-                           int count, struct llog_logid *logid);
-        int (*o_llog_finish)(struct obd_device *obd, int count);
-
-        /* only until proper file size mechanics arrive */
-        int (*o_lock_contains)(struct obd_export *exp, 
-                               struct lov_stripe_md *lsm, 
-                               struct ldlm_lock *lock, obd_off offset);
+        int (*o_llog_init)(struct obd_device *, struct obd_llogs *,
+                           struct obd_device *, int, struct llog_catid *);
+        int (*o_llog_finish)(struct obd_device *, struct obd_llogs *, int);
+        int (*o_llog_connect)(struct obd_device *, struct llogd_conn_body *);
 
+       
         /* metadata-only methods */
         int (*o_pin)(struct obd_export *, obd_id ino, __u32 gen, int type,
                      struct obd_client_handle *, int flag);
         int (*o_unpin)(struct obd_export *, struct obd_client_handle *, int);
 
-        int (*o_invalidate_import)(struct obd_device *, struct obd_import *);
+        int (*o_import_event)(struct obd_device *, struct obd_import *,
+                              enum obd_import_event);
 
         int (*o_notify)(struct obd_device *obd, struct obd_device *watched,
                         int active);
+        int (*o_init_ea_size)(struct obd_export *, int, int);
+
         /* 
          * NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line
          * to lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c.
          * Also, add a wrapper function in include/linux/obd_class.h.
          */
-
 };
 
+struct ll_uctxt;
+
+struct md_ops {
+        int (*m_getstatus)(struct obd_export *, struct ll_fid *);
+        int (*m_change_cbdata)(struct obd_export *, struct ll_fid *,
+                               ldlm_iterator_t, void *);
+        int (*m_change_cbdata_name)(struct obd_export *, struct ll_fid *,
+                                    char *, int, struct ll_fid *,
+                                    ldlm_iterator_t, void *);
+        int (*m_close)(struct obd_export *, struct obdo *,
+                       struct obd_client_handle *,
+                       struct ptlrpc_request **);
+        int (*m_create)(struct obd_export *, struct mdc_op_data *,
+                        const void *, int, int, __u32, __u32,
+                        __u64, struct ptlrpc_request **);
+        int (*m_done_writing)(struct obd_export *, struct obdo *);
+        int (*m_enqueue)(struct obd_export *, int, struct lookup_intent *,
+                         int, struct mdc_op_data *, struct lustre_handle *,
+                         void *, int, ldlm_completion_callback,
+                         ldlm_blocking_callback, void *);
+        int (*m_getattr)(struct obd_export *, struct ll_fid *,
+                         unsigned long, unsigned int,
+                         struct ptlrpc_request **);
+        int (*m_getattr_name)(struct obd_export *, struct ll_fid *,
+                              char *, int, unsigned long,
+                              unsigned int, struct ptlrpc_request **);
+        int (*m_intent_lock)(struct obd_export *, struct ll_uctxt *,
+                             struct ll_fid *, const char *, int,
+                             void *, int, struct ll_fid *,
+                             struct lookup_intent *, int,
+                             struct ptlrpc_request **,
+                             ldlm_blocking_callback);
+        int (*m_link)(struct obd_export *, struct mdc_op_data *,
+                      struct ptlrpc_request **);
+        int (*m_rename)(struct obd_export *, struct mdc_op_data *,
+                        const char *, int, const char *, int,
+                        struct ptlrpc_request **);
+        int (*m_setattr)(struct obd_export *, struct mdc_op_data *,
+                         struct iattr *, void *, int , void *, int,
+                         struct ptlrpc_request **);
+        int (*m_sync)(struct obd_export *, struct ll_fid *,
+                      struct ptlrpc_request **);
+        int (*m_readpage)(struct obd_export *, struct ll_fid *,
+                          __u64, struct page *, struct ptlrpc_request **);
+        int (*m_unlink)(struct obd_export *, struct mdc_op_data *,
+                        struct ptlrpc_request **);
+        int (*m_valid_attrs)(struct obd_export *, struct ll_fid *);
+        struct obd_device * (*m_get_real_obd)(struct obd_export *,
+                             char *name, int len);
+        
+        int (*m_req2lustre_md)(struct obd_export *exp, 
+                               struct ptlrpc_request *req, unsigned int offset,
+                               struct obd_export *osc_exp, struct lustre_md *md);
+        int (*m_set_open_replay_data)(struct obd_export *exp,
+                                      struct obd_client_handle *och,
+                                      struct ptlrpc_request *open_req);
+        int (*m_clear_open_replay_data)(struct obd_export *exp,
+                                        struct obd_client_handle *och);
+        int (*m_store_inode_generation)(struct obd_export *exp, 
+                                        struct ptlrpc_request *req, int reqoff,
+                                        int repoff);
+        int (*m_set_lock_data)(struct obd_export *exp, __u64 *l, void *data);
+
+        /* 
+         * NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line
+         * to lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c.
+         * Also, add a wrapper function in include/linux/obd_class.h.
+         */
+};
 
 static inline void obd_transno_commit_cb(struct obd_device *obd, __u64 transno,
                                          int error)
@@ -639,7 +830,7 @@ static inline void obd_transno_commit_cb(struct obd_device *obd, __u64 transno,
                obd->obd_name, transno);
         if (transno > obd->obd_last_committed) {
                 obd->obd_last_committed = transno;
-                wake_up(&obd->obd_commit_waitq);
+                ptlrpc_commit_replies (obd);
         }
 }