Whamcloud - gitweb
b=16150
[fs/lustre-release.git] / lustre / liblustre / rw.c
index 8f0e23a..53bda1f 100644 (file)
@@ -16,8 +16,8 @@
  * in the LICENSE file that accompanied this code).
  *
  * You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
  *
  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
  * CA 95054 USA or visit www.sun.com if you need additional information or
@@ -74,14 +74,14 @@ struct llu_io_group
         int                     lig_npages;
         __u64                   lig_rwcount;
         struct ll_async_page   *lig_llaps;
-        struct page            *lig_pages;
+        cfs_page_t             *lig_pages;
         void                   *lig_llap_cookies;
 };
 
 #define LLU_IO_GROUP_SIZE(x) \
         (sizeof(struct llu_io_group) + \
          (sizeof(struct ll_async_page) + \
-          sizeof(struct page) + \
+          sizeof(cfs_page_t) + \
           llap_cookie_size) * (x))
 
 struct llu_io_session
@@ -417,10 +417,17 @@ struct ll_async_page {
         int             llap_magic;
         void           *llap_cookie;
         int             llap_queued;
-        struct page    *llap_page;
+        cfs_page_t     *llap_page;
         struct inode   *llap_inode;
 };
 
+static inline struct ll_async_page *llap_from_cookie(void *ptr)
+{
+        struct ll_async_page *ap = ptr;
+        LASSERT(ap->llap_magic == LLAP_MAGIC);
+        return ap;
+}
+
 static void llu_ap_fill_obdo(void *data, int cmd, struct obdo *oa)
 {
         struct ll_async_page *llap;
@@ -429,7 +436,7 @@ static void llu_ap_fill_obdo(void *data, int cmd, struct obdo *oa)
         obd_flag valid_flags;
         ENTRY;
 
-        llap = LLAP_FROM_COOKIE(data);
+        llap = llap_from_cookie(data);
         inode = llap->llap_inode;
         lsm = llu_i2info(inode)->lli_smd;
 
@@ -451,7 +458,7 @@ static void llu_ap_update_obdo(void *data, int cmd, struct obdo *oa,
         struct ll_async_page *llap;
         ENTRY;
 
-        llap = LLAP_FROM_COOKIE(data);
+        llap = llap_from_cookie(data);
         obdo_from_inode(oa, llap->llap_inode, valid);
 
         EXIT;
@@ -461,10 +468,10 @@ static void llu_ap_update_obdo(void *data, int cmd, struct obdo *oa,
 static int llu_ap_completion(void *data, int cmd, struct obdo *oa, int rc)
 {
         struct ll_async_page *llap;
-        struct page *page;
+        cfs_page_t *page;
         ENTRY;
 
-        llap = LLAP_FROM_COOKIE(data);
+        llap = llap_from_cookie(data);
         llap->llap_queued = 0;
         page = llap->llap_page;
 
@@ -497,7 +504,7 @@ static int llu_queue_pio(int cmd, struct llu_io_group *group,
         struct intnl_stat *st = llu_i2stat(group->lig_inode);
         struct lov_stripe_md *lsm = lli->lli_smd;
         struct obd_export *exp = llu_i2obdexp(group->lig_inode);
-        struct page *pages = &group->lig_pages[group->lig_npages],*page = pages;
+        cfs_page_t *pages = &group->lig_pages[group->lig_npages],*page = pages;
         struct ll_async_page *llap = &group->lig_llaps[group->lig_npages];
         void *llap_cookie = group->lig_llap_cookies +
                 llap_cookie_size * group->lig_npages;
@@ -639,7 +646,7 @@ struct llu_io_group * get_io_group(struct inode *inode, int maxpages,
         group->lig_maxpages = maxpages;
         group->lig_params = params;
         group->lig_llaps = (struct ll_async_page *)(group + 1);
-        group->lig_pages = (struct page *)(&group->lig_llaps[maxpages]);
+        group->lig_pages = (cfs_page_t *)(&group->lig_llaps[maxpages]);
         group->lig_llap_cookies = (void *)(&group->lig_pages[maxpages]);
 
         rc = oig_init(&group->lig_oig);