/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Lustre Light block IO
+ * GPL HEADER START
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright (c) 2002-2004 Cluster File Systems, Inc.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
*
- * This file is part of Lustre, http://www.lustre.org.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
*
- * Lustre is free software; you can redistribute it and/or
- * modify it under the terms of version 2 of the GNU General Public
- * License as published by the Free Software Foundation.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
- * Lustre is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
*
- * You should have received a copy of the GNU General Public License
- * along with Lustre; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * GPL HEADER END
+ */
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * lustre/liblustre/rw.c
+ *
+ * Lustre Light block IO
*/
#define DEBUG_SUBSYSTEM S_LLITE
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
struct {
char name[16];
struct ldlm_lock *lock;
- struct lov_stripe_md *lsm;
- } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock, .lsm = lsm };
+ } key = { .name = KEY_LOCK_TO_STRIPE, .lock = lock };
__u32 stripe, vallen = sizeof(stripe);
int rc;
ENTRY;
RETURN(0);
/* get our offset in the lov */
- rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe);
+ rc = obd_get_info(exp, sizeof(key), &key, &vallen, &stripe, lsm);
if (rc != 0) {
CERROR("obd_get_info: rc = %d\n", rc);
LBUG();
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;
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;
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;
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;
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;
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);