Whamcloud - gitweb
b=2109
authorzab <zab>
Fri, 17 Oct 2003 01:48:00 +0000 (01:48 +0000)
committerzab <zab>
Fri, 17 Oct 2003 01:48:00 +0000 (01:48 +0000)
Flesh out the async OBD IO API to be more user friendly.  llite behaviour
should be the same, but easier to follow.  Each OBD layer gets its own
struct of state to associate with a page in flight.  A struct of callback
members is introduced to manage the communication between the obd async
api providers (lov/osc) and the callers (llite/lov).

This is landing now, instead of after 1.0, to give liblustre a more reasonable
interface into the RPC concurrency engine in the OSC.  This mechanism is most
evident in the part of ll_commit_write() that falls back to sync IO.  O_DIRECT
will also want to use this.

These changes pass acceptance-small on real hardware.

lustre/llite/llite_internal.h
lustre/lov/lov_internal.h

index d30e806..3ae02b0 100644 (file)
@@ -60,6 +60,15 @@ struct it_cb_data {
        obd_id hash;
 };
 
+#define LLAP_MAGIC 98764321
+
+struct ll_async_page {
+        int             llap_magic;
+        void            *llap_cookie;
+        int             llap_queued;
+        struct page     *llap_page;
+};
+
 /* llite/lproc_llite.c */
 int lprocfs_register_mountpoint(struct proc_dir_entry *parent,
                                 struct super_block *sb, char *osc, char *mdc);
@@ -88,18 +97,19 @@ int ll_prepare_write(struct file *file, struct page *page, unsigned from,
 int ll_commit_write(struct file *file, struct page *page, unsigned from,
                     unsigned to);
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
-#define ll_complete_writeback ll_complete_writepage_24
-void ll_complete_writepage_24(struct obd_client_page *ocp, int rc);
+#define ll_ap_completion ll_ap_completion_24
+void ll_ap_completion_24(void *data, int cmd, int rc);
 #else 
-#define ll_complete_writeback ll_complete_writepage_26
-void ll_complete_writepage_26(struct obd_client_page *ocp, int rc);
+#define ll_ap_completion ll_ap_completion_26
+void ll_ap_completion_26(void *data, int cmd, int rc);
 #endif
-int ll_sync_page(struct page *page);
 int ll_ocp_update_obdo(struct obd_client_page *ocp, int cmd, struct obdo *oa);
 int ll_ocp_set_io_ready(struct obd_client_page *ocp, int cmd);
 int ll_ocp_update_io_args(struct obd_client_page *ocp, int cmd);
 void ll_removepage(struct page *page);
 int ll_readpage(struct file *file, struct page *page);
+struct ll_async_page *llap_from_cookie(void *cookie);
+struct ll_async_page *llap_from_page(struct page *page);
 
 void ll_truncate(struct inode *inode);
 
index c1a412c..77778fc 100644 (file)
@@ -7,6 +7,18 @@
  * See the file COPYING in this distribution
  */
 
+#define LAP_MAGIC 8200
+
+struct lov_async_page {
+        int                             lap_magic;
+        int                             lap_stripe;
+        obd_off                         lap_sub_offset;
+        void                            *lap_sub_cookie;
+        struct obd_async_page_ops       *lap_caller_ops;
+        struct obd_async_page_ops       *lap_caller_data;
+        obd_id                          lap_loi_id;
+};
+
 /* lov_obd.c */
 int lov_get_stripecnt(struct lov_obd *lov, int stripe_count);
 int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count);