# NOTE: keep extN before mds
SUBDIRS = lov utils obdclass ldlm ptlrpc llite lib obdecho mdc osc extN
SUBDIRS+= mds ost tests obdfilter demos doc scripts
-DIST_SUBDIRS = $(SUBDIRS) obdfs
+DIST_SUBDIRS = $(SUBDIRS)
EXTRA_DIST = BUGS FDL Rules include patches archdep.m4
# We get the version from the spec file.
# not needed until the AC_CHECK_LIB(readline) above works
# AM_CONFIG_HEADER(include/config.h)
-AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile \
- obdecho/Makefile ptlrpc/Makefile \
- lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile utils/Makefile \
- tests/Makefile obdfilter/Makefile obdclass/Makefile \
- llite/Makefile obdfs/Makefile demos/Makefile \
- doc/Makefile scripts/Makefile scripts/lustre.spec \
- extN/Makefile)
+AC_OUTPUT(Makefile lib/Makefile ldlm/Makefile obdecho/Makefile ptlrpc/Makefile \
+ lov/Makefile osc/Makefile mdc/Makefile mds/Makefile ost/Makefile \
+ utils/Makefile tests/Makefile obdfilter/Makefile obdclass/Makefile \
+ llite/Makefile demos/Makefile doc/Makefile scripts/Makefile \
+ scripts/lustre.spec extN/Makefile)
int ll_sync_io_cb(struct io_cb_data *data, int err, int phase);
struct io_cb_data *ll_init_cb(void);
-inline void lustre_put_page(struct page *page);
-struct page *lustre_get_page_read(struct inode *dir, unsigned long index);
-struct page *lustre_get_page_write(struct inode *dir, unsigned long index);
-int lustre_commit_write(struct page *page, unsigned from, unsigned to);
-void set_page_clean(struct page *page);
-void set_page_dirty(struct page *page);
/* simple.c */
struct obd_run_ctxt;
char *cluuid);
int class_disconnect(struct lustre_handle *conn);
void class_disconnect_all(struct obd_device *obddev);
-struct obd_export *class_conn2export(struct lustre_handle *);
/* generic operations shared by various OBD types */
int class_multi_setup(struct obd_device *obddev, uint32_t len, void *data);
/*
* Indicate that we're waiting for a client to call us back cancelling a given
* lock. We add it to the pending-callback chain, and schedule the lock-timeout
- * timer to fire appropriately. (We round up to the next second, to avoid floods
- * of timer firings during periods of high lock contention and traffic.
+ * timer to fire appropriately. (We round up to the next second, to avoid
+ * floods of timer firings during periods of high lock contention and traffic.
*/
-int ldlm_add_waiting_lock(struct ldlm_lock *lock)
+static int ldlm_add_waiting_lock(struct ldlm_lock *lock)
{
unsigned long timeout_rounded;
ENTRY;
* callback arrive without incident. This adjusts the lock-timeout timer if
* needed. Returns 0 if the lock wasn't pending after all, 1 if it was.
*/
-int ldlm_del_waiting_lock(struct ldlm_lock *lock)
+static int ldlm_del_waiting_lock(struct ldlm_lock *lock)
{
struct list_head *list_next;
+++ /dev/null
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
- * Copyright (C) 2001, 2002 Cluster File Systems, Inc.
- *
- * This file is part of Lustre, http://www.sf.net/projects/lustre/
- *
- * 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.
- *
- * 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.
- *
- * 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.
- *
- */
-
-
-
-#include <linux/config.h>
-#include <linux/kernel.h>
-#include <linux/mm.h>
-#include <linux/string.h>
-#include <linux/stat.h>
-#include <linux/errno.h>
-#include <linux/locks.h>
-#include <linux/unistd.h>
-#include <linux/version.h>
-
-#include <asm/system.h>
-#include <asm/uaccess.h>
-
-#include <linux/fs.h>
-#include <linux/stat.h>
-#include <asm/uaccess.h>
-#include <asm/segment.h>
-#include <linux/mm.h>
-#include <linux/pagemap.h>
-#include <linux/smp_lock.h>
-
-#define DEBUG_SUBSYSTEM S_OST
-
-#include <linux/obd_class.h>
-#include <linux/lustre_net.h>
-#include <linux/lustre_lib.h>
-#include <linux/lustre_ha.h>
-
-static int sync_io_timeout(void *data)
-{
- struct io_cb_data *cbd = data;
- struct ptlrpc_bulk_desc *desc = cbd->desc;
-
- ENTRY;
- desc->bd_connection->c_level = LUSTRE_CONN_RECOVD;
- desc->bd_flags |= PTL_RPC_FL_TIMEOUT;
- if (desc->bd_connection && class_signal_connection_failure) {
-
- /* XXXshaver Do we need a resend strategy, or do we just
- * XXXshaver return -ERESTARTSYS and punt it?
- */
- CERROR("signalling failure of conn %p\n", desc->bd_connection);
- class_signal_connection_failure(desc->bd_connection);
-
- /* We go back to sleep, until we're resumed or interrupted. */
- RETURN(0);
- }
-
- /* If we can't be recovered, just abort the syscall with -ETIMEDOUT. */
- RETURN(1);
-}
-
-static int sync_io_intr(void *data)
-{
- struct io_cb_data *cbd = data;
- struct ptlrpc_bulk_desc *desc = cbd->desc;
-
- ENTRY;
- desc->bd_flags |= PTL_RPC_FL_INTR;
- RETURN(1); /* ignored, as of this writing */
-}
-
-int ll_sync_io_cb(struct io_cb_data *data, int err, int phase)
-{
- int ret;
- ENTRY;
-
- if (phase == CB_PHASE_START) {
- struct l_wait_info lwi;
- lwi = LWI_TIMEOUT_INTR(obd_timeout * HZ, sync_io_timeout,
- sync_io_intr, data);
- ret = l_wait_event(data->waitq, data->complete, &lwi);
- if (atomic_dec_and_test(&data->refcount))
- OBD_FREE(data, sizeof(*data));
- if (ret == -ERESTARTSYS)
- return ret;
- } else if (phase == CB_PHASE_FINISH) {
- data->err = err;
- data->complete = 1;
- wake_up(&data->waitq);
- if (atomic_dec_and_test(&data->refcount))
- OBD_FREE(data, sizeof(*data));
- return err;
- } else
- LBUG();
- EXIT;
- return 0;
-}
-
-struct io_cb_data *ll_init_cb(void)
-{
- struct io_cb_data *d;
-
-
- OBD_ALLOC(d, sizeof(*d));
- if (d) {
- init_waitqueue_head(&d->waitq);
- atomic_set(&d->refcount, 2);
- }
- RETURN(d);
-}
-
-/*
- * Remove page from dirty list
- */
-static void __set_page_clean(struct page *page)
-{
- struct address_space *mapping = page->mapping;
- struct inode *inode;
-
- if (!mapping)
- return;
-
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,9))
- spin_lock(&pagecache_lock);
-#endif
-
- list_del(&page->list);
- list_add(&page->list, &mapping->clean_pages);
-
- inode = mapping->host;
- if (list_empty(&mapping->dirty_pages)) {
- CDEBUG(D_INODE, "inode clean\n");
- inode->i_state &= ~I_DIRTY_PAGES;
- }
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,10))
- spin_unlock(&pagecache_lock);
-#endif
- EXIT;
-}
-
-inline void set_page_clean(struct page *page)
-{
- if (PageDirty(page)) {
- ClearPageDirty(page);
- __set_page_clean(page);
- }
-}
-
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10))
-/*
- * Add a page to the dirty page list.
- */
-void __set_page_dirty(struct page *page)
-{
- struct address_space *mapping;
- spinlock_t *pg_lock;
-
- pg_lock = PAGECACHE_LOCK(page);
- spin_lock(pg_lock);
-
- mapping = page->mapping;
- spin_lock(&mapping->page_lock);
-
- list_del(&page->list);
- list_add(&page->list, &mapping->dirty_pages);
-
- spin_unlock(&mapping->page_lock);
- spin_unlock(pg_lock);
-
- if (mapping->host)
- mark_inode_dirty_pages(mapping->host);
-}
-#else
-/*
- * Add a page to the dirty page list.
- */
-void set_page_dirty(struct page *page)
-{
- if (!test_and_set_bit(PG_dirty, &page->flags)) {
- struct address_space *mapping = page->mapping;
-
- if (mapping) {
- spin_lock(&pagecache_lock);
- list_del(&page->list);
- list_add(&page->list, &mapping->dirty_pages);
- spin_unlock(&pagecache_lock);
-
- if (mapping->host)
- mark_inode_dirty_pages(mapping->host);
- }
- }
-}
-#endif
-
-inline void lustre_put_page(struct page *page)
-{
- kunmap(page);
- page_cache_release(page);
-}
-
-struct page *lustre_get_page_read(struct inode *inode, unsigned long index)
-{
- struct address_space *mapping = inode->i_mapping;
- struct page *page;
- int rc;
-
- page = read_cache_page(mapping, index,
- (filler_t*)mapping->a_ops->readpage, NULL);
- if (!IS_ERR(page)) {
- wait_on_page(page);
- kmap(page);
- if (!Page_Uptodate(page)) {
- CERROR("page index %lu not uptodate\n", index);
- GOTO(err_page, rc = -EIO);
- }
- if (PageError(page)) {
- CERROR("page index %lu has error\n", index);
- GOTO(err_page, rc = -EIO);
- }
- }
- return page;
-
-err_page:
- lustre_put_page(page);
- return ERR_PTR(rc);
-}
-
-struct page *lustre_get_page_write(struct inode *inode, unsigned long index)
-{
- struct address_space *mapping = inode->i_mapping;
- struct page *page;
- int rc;
-
- page = grab_cache_page(mapping, index); /* locked page */
-
- if (!IS_ERR(page)) {
- kmap(page);
- /* Note: Called with "O" and "PAGE_SIZE" this is essentially
- * a no-op for most filesystems, because we write the whole
- * page. For partial-page I/O this will read in the page.
- */
- rc = mapping->a_ops->prepare_write(NULL, page, 0, PAGE_SIZE);
- if (rc) {
- CERROR("page index %lu, rc = %d\n", index, rc);
- if (rc != -ENOSPC)
- LBUG();
- GOTO(err_unlock, rc);
- }
- /* XXX not sure if we need this if we are overwriting page */
- if (PageError(page)) {
- CERROR("error on page index %lu, rc = %d\n", index, rc);
- LBUG();
- GOTO(err_unlock, rc = -EIO);
- }
- }
- return page;
-
-err_unlock:
- unlock_page(page);
- lustre_put_page(page);
- return ERR_PTR(rc);
-}
-
-int lustre_commit_write(struct page *page, unsigned from, unsigned to)
-{
- struct inode *inode = page->mapping->host;
- int err;
-
- err = page->mapping->a_ops->commit_write(NULL, page, from, to);
- if (!err && IS_SYNC(inode))
- err = waitfor_one_page(page);
-
- //SetPageUptodate(page); // the client commit_write will do this
-
- SetPageReferenced(page);
- unlock_page(page);
- lustre_put_page(page);
- return err;
-}
modulefs_DATA = llite.o
EXTRA_PROGRAMS = llite
-page.c:
- test -e page.c || ln -sf $(top_srcdir)/lib/page.c
-
-
-LINX=page.c
llite_SOURCES = dcache.c commit_callback.c super.c rw.c
-llite_SOURCES += file.c dir.c sysctl.c namei.c symlink.c $(LINX)
+llite_SOURCES += file.c dir.c sysctl.c namei.c symlink.c
llite_SOURCES += lov_pack.c
-dist-hook:
- list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done
-
lov_pack.c:
test -e lov_pack.c || ln -sf $(top_srcdir)/lib/lov_pack.c .
#include <linux/lustre_lite.h>
#include <linux/lustre_lib.h>
+/*
+ * Remove page from dirty list
+ */
+static void __set_page_clean(struct page *page)
+{
+ struct address_space *mapping = page->mapping;
+ struct inode *inode;
+
+ if (!mapping)
+ return;
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,9))
+ spin_lock(&pagecache_lock);
+#endif
+
+ list_del(&page->list);
+ list_add(&page->list, &mapping->clean_pages);
+
+ inode = mapping->host;
+ if (list_empty(&mapping->dirty_pages)) {
+ CDEBUG(D_INODE, "inode clean\n");
+ inode->i_state &= ~I_DIRTY_PAGES;
+ }
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,4,10))
+ spin_unlock(&pagecache_lock);
+#endif
+ EXIT;
+}
+
+inline void set_page_clean(struct page *page)
+{
+ if (PageDirty(page)) {
+ ClearPageDirty(page);
+ __set_page_clean(page);
+ }
+}
/* SYNCHRONOUS I/O to object storage for an inode */
static int ll_brw(int rw, struct inode *inode, struct page *page, int create)
EXTRA_PROGRAMS = lov
LINX= lov_pack.c
-lov_SOURCES = lov_obd.c page.c $(LINX)
+lov_SOURCES = lov_obd.c $(LINX)
lov_pack.c:
test -e lov_pack.c || ln -sf $(top_srcdir)/lib/lov_pack.c
-page.c:
- test -e page.c || ln -sf $(top_srcdir)/lib/page.c
-
include $(top_srcdir)/Rules
MODULE = obdclass
modulefs_DATA = obdclass.o
EXTRA_PROGRAMS = obdclass
-LINX=page.c debug.c
-obdclass_SOURCES = genops.c proc_lustre.c class_obd.c sysctl.c uuid.c $(LINX)
-
-debug.c:
- test -e debug.c || ln -sf $(top_srcdir)/lib/debug.c
-
-page.c:
- test -e page.c || ln -sf $(top_srcdir)/lib/page.c
+obdclass_SOURCES = debug.c genops.c proc_lustre.c class_obd.c sysctl.c uuid.c
include $(top_srcdir)/Rules
EXPORT_SYMBOL(class_signal_connection_failure);
EXPORT_SYMBOL(mds_destroy_export);
EXPORT_SYMBOL(ldlm_destroy_export);
+EXPORT_SYMBOL(ll_sync_io_cb);
+EXPORT_SYMBOL(ll_init_cb);
static int __init init_obdclass(void)
{
kmem_cache_t *export_cachep = NULL;
kmem_cache_t *import_cachep = NULL;
+/* I would prefer if these next four functions were in ptlrpc, to be honest,
+ * but obdclass uses them for the netregression ioctls. -phil */
+static int sync_io_timeout(void *data)
+{
+ struct io_cb_data *cbd = data;
+ struct ptlrpc_bulk_desc *desc = cbd->desc;
+
+ ENTRY;
+ desc->bd_connection->c_level = LUSTRE_CONN_RECOVD;
+ desc->bd_flags |= PTL_RPC_FL_TIMEOUT;
+ if (desc->bd_connection && class_signal_connection_failure) {
+
+ /* XXXshaver Do we need a resend strategy, or do we just
+ * XXXshaver return -ERESTARTSYS and punt it?
+ */
+ CERROR("signalling failure of conn %p\n", desc->bd_connection);
+ class_signal_connection_failure(desc->bd_connection);
+
+ /* We go back to sleep, until we're resumed or interrupted. */
+ RETURN(0);
+ }
+
+ /* If we can't be recovered, just abort the syscall with -ETIMEDOUT. */
+ RETURN(1);
+}
+
+static int sync_io_intr(void *data)
+{
+ struct io_cb_data *cbd = data;
+ struct ptlrpc_bulk_desc *desc = cbd->desc;
+
+ ENTRY;
+ desc->bd_flags |= PTL_RPC_FL_INTR;
+ RETURN(1); /* ignored, as of this writing */
+}
+
+int ll_sync_io_cb(struct io_cb_data *data, int err, int phase)
+{
+ int ret;
+ ENTRY;
+
+ if (phase == CB_PHASE_START) {
+ struct l_wait_info lwi;
+ lwi = LWI_TIMEOUT_INTR(obd_timeout * HZ, sync_io_timeout,
+ sync_io_intr, data);
+ ret = l_wait_event(data->waitq, data->complete, &lwi);
+ if (atomic_dec_and_test(&data->refcount))
+ OBD_FREE(data, sizeof(*data));
+ if (ret == -ERESTARTSYS)
+ return ret;
+ } else if (phase == CB_PHASE_FINISH) {
+ data->err = err;
+ data->complete = 1;
+ wake_up(&data->waitq);
+ if (atomic_dec_and_test(&data->refcount))
+ OBD_FREE(data, sizeof(*data));
+ return err;
+ } else
+ LBUG();
+ EXIT;
+ return 0;
+}
+
+struct io_cb_data *ll_init_cb(void)
+{
+ struct io_cb_data *d;
+
+ OBD_ALLOC(d, sizeof(*d));
+ if (d) {
+ init_waitqueue_head(&d->waitq);
+ atomic_set(&d->refcount, 2);
+ }
+ RETURN(d);
+}
+
/*
* support functions: we could use inter-module communication, but this
* is more portable to other OS's
modulefs_DATA = obdfilter.o
EXTRA_PROGRAMS = obdfilter
-LINX=page.c simple.c
+LINX=simple.c
simple.c:
test -e simple.c || ln -sf $(top_srcdir)/lib/simple.c
-page.c:
- test -e page.c || ln -sf $(top_srcdir)/lib/page.c
FILTERC = filter.c
obdfilter_SOURCES = $(FILTERC) $(LINX)
return rc;
}
+static inline void lustre_put_page(struct page *page)
+{
+ kunmap(page);
+ page_cache_release(page);
+}
+
+static struct page *
+lustre_get_page_read(struct inode *inode, unsigned long index)
+{
+ struct address_space *mapping = inode->i_mapping;
+ struct page *page;
+ int rc;
+
+ page = read_cache_page(mapping, index,
+ (filler_t*)mapping->a_ops->readpage, NULL);
+ if (!IS_ERR(page)) {
+ wait_on_page(page);
+ kmap(page);
+ if (!Page_Uptodate(page)) {
+ CERROR("page index %lu not uptodate\n", index);
+ GOTO(err_page, rc = -EIO);
+ }
+ if (PageError(page)) {
+ CERROR("page index %lu has error\n", index);
+ GOTO(err_page, rc = -EIO);
+ }
+ }
+ return page;
+
+err_page:
+ lustre_put_page(page);
+ return ERR_PTR(rc);
+}
+
+static struct page *
+lustre_get_page_write(struct inode *inode, unsigned long index)
+{
+ struct address_space *mapping = inode->i_mapping;
+ struct page *page;
+ int rc;
+
+ page = grab_cache_page(mapping, index); /* locked page */
+
+ if (!IS_ERR(page)) {
+ kmap(page);
+ /* Note: Called with "O" and "PAGE_SIZE" this is essentially
+ * a no-op for most filesystems, because we write the whole
+ * page. For partial-page I/O this will read in the page.
+ */
+ rc = mapping->a_ops->prepare_write(NULL, page, 0, PAGE_SIZE);
+ if (rc) {
+ CERROR("page index %lu, rc = %d\n", index, rc);
+ if (rc != -ENOSPC)
+ LBUG();
+ GOTO(err_unlock, rc);
+ }
+ /* XXX not sure if we need this if we are overwriting page */
+ if (PageError(page)) {
+ CERROR("error on page index %lu, rc = %d\n", index, rc);
+ LBUG();
+ GOTO(err_unlock, rc = -EIO);
+ }
+ }
+ return page;
+
+err_unlock:
+ unlock_page(page);
+ lustre_put_page(page);
+ return ERR_PTR(rc);
+}
+
+static int lustre_commit_write(struct page *page, unsigned from, unsigned to)
+{
+ struct inode *inode = page->mapping->host;
+ int err;
+
+ err = page->mapping->a_ops->commit_write(NULL, page, from, to);
+ if (!err && IS_SYNC(inode))
+ err = waitfor_one_page(page);
+
+ //SetPageUptodate(page); // the client commit_write will do this
+
+ SetPageReferenced(page);
+ unlock_page(page);
+ lustre_put_page(page);
+ return err;
+}
+
struct page *filter_get_page_write(struct inode *inode, unsigned long index,
struct niobuf_local *lnb, int *pglocked)
{
return err;
} /* obdfs_brw */
-extern void set_page_clean(struct page *);
-
/* SYNCHRONOUS I/O to object storage for an inode -- object attr will be updated too */
static int obdfs_commit_page(struct page *page, int create, int from, int to)
{
#include <linux/obd_support.h> /* for OBD_FAIL_CHECK */
#include <linux/lustre_lite.h> /* for ll_i2info */
-static int osc_getattr(struct lustre_handle *conn, struct obdo *oa,
+static int osc_getattr(struct lustre_handle *conn, struct obdo *oa,
struct lov_stripe_md *md)
{
struct ptlrpc_request *request;
int rc, size = sizeof(*body);
ENTRY;
- request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_GETATTR, 1, &size,
- NULL);
+ request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_GETATTR, 1,
+ &size, NULL);
if (!request)
RETURN(-ENOMEM);
int rc, size = sizeof(*body);
ENTRY;
- request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_SETATTR, 1, &size,
- NULL);
+ request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_SETATTR, 1,
+ &size, NULL);
if (!request)
RETURN(-ENOMEM);
rc = ptlrpc_queue_wait(request);
rc = ptlrpc_check_status(request, rc);
- GOTO(out, rc);
- out:
ptlrpc_free_req(request);
return rc;
}
#warning FIXME: pack only valid fields instead of memcpy, endianness, valid
memcpy(&body->oa, oa, sizeof(*oa));
- /* overload the blocks and size fields in the oa with start/end */
+ /* overload the blocks and size fields in the oa with start/end */
#warning FIXME: endianness, size=start, blocks=end?
body->oa.o_blocks = start;
body->oa.o_size = end;
CERROR("oa NULL\n");
RETURN(-EINVAL);
}
- request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_DESTROY, 1, &size,
- NULL);
+ request = ptlrpc_prep_req(class_conn2cliimp(conn), OST_DESTROY, 1,
+ &size, NULL);
if (!request)
RETURN(-ENOMEM);
ENTRY;
if (desc->bd_flags & PTL_RPC_FL_TIMEOUT) {
- err = (desc->bd_flags & PTL_RPC_FL_INTR ? -ERESTARTSYS :
+ err = (desc->bd_flags & PTL_RPC_FL_INTR ? -ERESTARTSYS :
-ETIMEDOUT);
}
* such as a timeout in a sleep that it performs, brw_finish
* will never get called, and we'll leak the desc, fail to kunmap
* things, cats will live with dogs. One solution would be to
- * export brw_finish as osc_brw_finish, so that the timeout case and
- * its kin could call it for proper cleanup. An alternative would
- * be for an error return from the callback to cause us to clean up,
- * but that doesn't help the truly async cases (like LOV), which
- * will immediately return from their PHASE_START callback, before
- * any such cleanup-requiring error condition can be detected.
+ * export brw_finish as osc_brw_finish, so that the timeout case
+ * and its kin could call it for proper cleanup. An alternative
+ * would be for an error return from the callback to cause us to
+ * clean up, but that doesn't help the truly async cases (like
+ * LOV), which will immediately return from their PHASE_START
+ * callback, before any such cleanup-requiring error condition can
+ * be detected.
*/
if (rc)
GOTO(out_req, rc);
/* Callbacks cause asynchronous handling. */
- rc = callback(data, 0, CB_PHASE_START);
+ rc = callback(data, 0, CB_PHASE_START);
out_req:
ptlrpc_req_finished(request);
return osc_brw_read(conn, md, page_count, pga, callback, data);
}
-static int osc_enqueue(struct lustre_handle *connh, struct lov_stripe_md *md,
- struct lustre_handle *parent_lock,
+static int osc_enqueue(struct lustre_handle *connh, struct lov_stripe_md *md,
+ struct lustre_handle *parent_lock,
__u32 type, void *extentp, int extent_len, __u32 mode,
int *flags, void *callback, void *data, int datalen,
struct lustre_handle *lockh)
int err = 0;
ENTRY;
- if (_IOC_TYPE(cmd) != IOC_LDLM_TYPE || _IOC_NR(cmd) <
- IOC_LDLM_MIN_NR || _IOC_NR(cmd) > IOC_LDLM_MAX_NR) {
+ if (_IOC_TYPE(cmd) != IOC_LDLM_TYPE ||
+ _IOC_NR(cmd) < IOC_LDLM_MIN_NR || _IOC_NR(cmd) > IOC_LDLM_MAX_NR) {
CDEBUG(D_IOCTL, "invalid ioctl (type %ld, nr %ld, size %ld)\n",
- _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
+ _IOC_TYPE(cmd), _IOC_NR(cmd), _IOC_SIZE(cmd));
RETURN(-EINVAL);
}
GOTO(out, err);
}
case IOC_LDLM_REGRESS_START: {
- unsigned int numthreads = 1;
- unsigned int numheld = 10;
- unsigned int numres = 10;
+ unsigned int numthreads = 1;
+ unsigned int numheld = 10;
+ unsigned int numres = 10;
unsigned int numext = 10;
char *parse;
-
+
if (data->ioc_inllen1) {
parse = data->ioc_inlbuf1;
if (*parse != '\0') {
}
}
- err = ldlm_regression_start(obddev, conn, numthreads,
+ err = ldlm_regression_start(obddev, conn, numthreads,
numheld, numres, numext);
CERROR("-- done err %d\n", err);
modulefs_DATA = ost.o
EXTRA_PROGRAMS = ost
-LINX=page.c obd_pack.c l_net.c ll_pack.c
+LINX=obd_pack.c l_net.c ll_pack.c
ll_pack.c:
test -e ll_pack.c || ln -sf $(top_srcdir)/lib/ll_pack.c
obd_pack.c:
test -e obd_pack.c || ln -sf $(top_srcdir)/lib/obd_pack.c
-page.c:
- test -e page.c || ln -sf $(top_srcdir)/lib/page.c
-
l_net.c:
test -e l_net.c || ln -sf $(top_srcdir)/lib/l_net.c
list='$(LINX)'; for f in $$list; do rm -f $(distdir)/$$f; done
include $(top_srcdir)/Rules
-
}
struct ptlrpc_service *
-ptlrpc_init_svc(__u32 bufsize, int nbuffs, int req_portal, int rep_portal, char *uuid,
- svc_handler_t handler, char *name)
+ptlrpc_init_svc(__u32 bufsize, int nbuffs, int req_portal, int rep_portal,
+ char *uuid, svc_handler_t handler, char *name)
{
int err;
int rc, i;
}
/* NB We need exactly 1 event for each buffer we queue */
- rc = PtlEQAlloc(service->srv_self.peer_ni, service->srv_nbuffs,
+ rc = PtlEQAlloc(service->srv_self.peer_ni, service->srv_nbuffs,
request_in_callback, &(service->srv_eq_h));
if (rc != PTL_OK) {
RETURN(NULL);
}
- OBD_ALLOC(service->srv_rqbds,
- service->srv_nbuffs * sizeof (struct ptlrpc_request_buffer_desc));
+ OBD_ALLOC(service->srv_rqbds, service->srv_nbuffs *
+ sizeof(struct ptlrpc_request_buffer_desc));
if (service->srv_rqbds == NULL) {
CERROR("no memory\n");
LBUG();
GOTO(failed, NULL);
}
-
+
for (i = 0; i < service->srv_nbuffs; i++) {
- struct ptlrpc_request_buffer_desc *rqbd = &service->srv_rqbds[i];
-
+ struct ptlrpc_request_buffer_desc *rqbd =&service->srv_rqbds[i];
+
rqbd->rqbd_service = service;
ptl_set_inv_handle (&rqbd->rqbd_me_h);
OBD_ALLOC(rqbd->rqbd_buffer, service->srv_buf_size);
LASSERT (rqbd->rqbd_service == svc);
LASSERT (rqbd->rqbd_buffer == event->mem_desc.start);
LASSERT (event->offset == 0);
-
+
memset(&request, 0, sizeof(request));
request.rq_svc = svc;
request.rq_obd = obddev;
* We don't know how to find that from here. */
request.rq_peer.peer_ni = svc->srv_self.peer_ni;
- request.rq_export = class_conn2export((struct lustre_handle *) request.rq_reqmsg);
+ request.rq_export = class_conn2export((struct lustre_handle *)
+ request.rq_reqmsg);
if (request.rq_export) {
request.rq_connection = request.rq_export->exp_connection;
{
int rc, i;
- if (service->srv_rqbds != NULL)
- {
- for (i = 0; i < service->srv_nbuffs; i++) {
- struct ptlrpc_request_buffer_desc *rqbd = &service->srv_rqbds[i];
-
- if (rqbd->rqbd_buffer == NULL) /* no buffer allocated */
- continue; /* => never initialised */
-
- /* Buffer allocated => got linked */
- LASSERT (ptl_is_valid_handle (&rqbd->rqbd_me_h));
-
- rc = PtlMEUnlink(rqbd->rqbd_me_h);
- if (rc)
- CERROR("PtlMEUnlink failed: %d\n", rc);
-
- OBD_FREE(rqbd->rqbd_buffer, service->srv_buf_size);
- }
+ for (i = 0; i < service->srv_nbuffs; i++) {
+ struct ptlrpc_request_buffer_desc *rqbd =&service->srv_rqbds[i];
- OBD_FREE(service->srv_rqbds,
- service->srv_nbuffs * sizeof (struct ptlrpc_request_buffer_desc));
+ if (rqbd->rqbd_buffer == NULL) /* no buffer allocated */
+ continue; /* => never initialised */
+
+ /* Buffer allocated => got linked */
+ LASSERT (ptl_is_valid_handle (&rqbd->rqbd_me_h));
+
+ rc = PtlMEUnlink(rqbd->rqbd_me_h);
+ if (rc)
+ CERROR("PtlMEUnlink failed: %d\n", rc);
+
+ OBD_FREE(rqbd->rqbd_buffer, service->srv_buf_size);
}
+ if (service->srv_rqbds != NULL)
+ OBD_FREE(service->srv_rqbds, service->srv_nbuffs *
+ sizeof (struct ptlrpc_request_buffer_desc));
+
rc = PtlEQFree(service->srv_eq_h);
if (rc)
CERROR("PtlEQFree failed: %d\n", rc);
}
OBD_FREE(service, sizeof(*service));
- if (rc)
+ if (rc)
LBUG();
return rc;
}
struct timeval start, next_time;
int pages = 1, objid = 3, count, next_count;
int verbose = 1, write = 0, rw;
- long long offset;
char *end;
int i;
int len;