From 3f4529794c5bced6a547e914470d509299bc5c6b Mon Sep 17 00:00:00 2001 From: pschwan Date: Mon, 29 Apr 2002 22:04:40 +0000 Subject: [PATCH] Trivial whitespace, struct, etc changes to bring the ldlm_testing branch more in line with the trunk. --- lustre/include/linux/lustre_lite.h | 3 +-- lustre/include/linux/obd.h | 7 +++++++ lustre/include/linux/obd_support.h | 40 +++++++++++++++++------------------ lustre/mds/handler.c | 13 +----------- lustre/ost/ost_handler.c | 11 +--------- lustre/ptlrpc/events.c | 43 +++++++++++++++----------------------- 6 files changed, 47 insertions(+), 70 deletions(-) diff --git a/lustre/include/linux/lustre_lite.h b/lustre/include/linux/lustre_lite.h index be70d95..9aa7ca6 100644 --- a/lustre/include/linux/lustre_lite.h +++ b/lustre/include/linux/lustre_lite.h @@ -46,8 +46,7 @@ struct ll_sb_info { ino_t ll_rootino; /* number of root inode */ struct ptlrpc_client ll_mds_client; struct ptlrpc_connection *ll_mds_conn; - struct ptlrpc_client ll_ost_client; - struct ptlrpc_connection *ll_ost_conn; + struct ldlm_namespace *ll_namespace; wait_queue_head_t ll_commitcbd_waitq; wait_queue_head_t ll_commitcbd_ctl_waitq; diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 36f3162..c98e785 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -175,6 +175,7 @@ struct obd_device { struct list_head obd_gen_clients; struct list_head obd_req_list; wait_queue_head_t obd_req_waitq; + struct ldlm_namespace *obd_namespace; union { struct ext2_obd ext2; struct filter_obd filter; @@ -240,6 +241,12 @@ struct obd_ops { int (*o_commitrw)(int cmd, struct obd_conn *conn, int objcount, struct obd_ioobj *obj, int niocount, struct niobuf *res); + int (*o_enqueue)(struct obd_conn *conn, struct ldlm_namespace *ns, + struct ldlm_handle *parent_lock, __u64 *res_id, + __u32 type, struct ldlm_extent *, __u32 mode, + int *flags, void *data, int datalen, + struct ldlm_handle *lockh); + int (*o_cancel)(struct obd_conn *, __u32 mode, struct ldlm_handle *); }; #endif diff --git a/lustre/include/linux/obd_support.h b/lustre/include/linux/obd_support.h index 209e3b9..46adb57 100644 --- a/lustre/include/linux/obd_support.h +++ b/lustre/include/linux/obd_support.h @@ -119,28 +119,28 @@ static inline void OBD_FAIL_WRITE(int id, kdev_t dev) } } -#define OBD_ALLOC(ptr, size) \ -do { \ - long s = (size); \ - (ptr) = kmalloc(s, GFP_KERNEL); \ - if ((ptr) == NULL) { \ - CERROR("kmalloc of '" #ptr "' (%ld bytes) failed " \ - "at %s:%d\n", s, __FILE__, __LINE__); \ - } else { \ - memset((ptr), 0, s); \ - obd_memory += s; \ - CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %ld at "\ - "%p (tot %ld).\n", s, (ptr), obd_memory);\ - } \ +#define OBD_ALLOC(ptr, size) \ +do { \ + long s = (size); \ + (ptr) = kmalloc(s, GFP_KERNEL); \ + if ((ptr) == NULL) { \ + CERROR("kmalloc of '" #ptr "' (%ld bytes) failed " \ + "at %s:%d\n", s, __FILE__, __LINE__); \ + } else { \ + memset((ptr), 0, s); \ + obd_memory += s; \ + CDEBUG(D_MALLOC, "kmalloced '" #ptr "': %ld at " \ + "%p (tot %ld).\n", s, (ptr), obd_memory); \ + } \ } while (0) -#define OBD_FREE(ptr, size) \ -do { \ - int s = (size); \ - kfree((ptr)); \ - CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %ld).\n", \ - s, (ptr), obd_memory); \ - obd_memory -= s; \ +#define OBD_FREE(ptr, size) \ +do { \ + int s = (size); \ + kfree((ptr)); \ + CDEBUG(D_MALLOC, "kfreed '" #ptr "': %d at %p (tot %ld).\n", \ + s, (ptr), obd_memory); \ + obd_memory -= s; \ } while (0) #endif diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 167aae4..e8bf419 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -17,21 +17,10 @@ */ #define EXPORT_SYMTAB - -#include -#include -#include -#include -#include -#include -#include -#include - #define DEBUG_SUBSYSTEM S_MDS +#include #include -#include -#include int mds_sendpage(struct ptlrpc_request *req, struct file *file, __u64 offset, struct niobuf *dst) diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index a0926f1..ac54fe6 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -31,18 +31,9 @@ */ #define EXPORT_SYMTAB - -#include -#include -#include -#include -#include -#include -#include -#include - #define DEBUG_SUBSYSTEM S_OST +#include #include #include diff --git a/lustre/ptlrpc/events.c b/lustre/ptlrpc/events.c index 2666fda..819e4f1 100644 --- a/lustre/ptlrpc/events.c +++ b/lustre/ptlrpc/events.c @@ -21,18 +21,13 @@ */ #define EXPORT_SYMTAB - -#include - #define DEBUG_SUBSYSTEM S_RPC +#include #include -ptl_handle_eq_t request_out_eq, - reply_in_eq, - reply_out_eq, - bulk_source_eq, - bulk_sink_eq; +ptl_handle_eq_t request_out_eq, reply_in_eq, reply_out_eq, bulk_source_eq, + bulk_sink_eq; static const ptl_handle_ni_t *socknal_nip = NULL, *qswnal_nip = NULL; /* @@ -41,8 +36,8 @@ static const ptl_handle_ni_t *socknal_nip = NULL, *qswnal_nip = NULL; static int request_out_callback(ptl_event_t *ev, void *data) { struct ptlrpc_request *req = ev->mem_desc.user_ptr; - struct ptlrpc_client *cl = req->rq_client; - + struct ptlrpc_client *cl = req->rq_client; + ENTRY; if (ev->type == PTL_EVENT_SENT) { @@ -50,9 +45,9 @@ static int request_out_callback(ptl_event_t *ev, void *data) list_del(&req->rq_list); list_add(&req->rq_list, &cl->cli_sent_head); spin_unlock(&req->rq_client->cli_lock); - } else { + } else { // XXX make sure we understand all events, including ACK's - CERROR("Unknown event %d\n", ev->type); + CERROR("Unknown event %d\n", ev->type); LBUG(); } @@ -69,9 +64,9 @@ static int reply_out_callback(ptl_event_t *ev, void *data) if (ev->type == PTL_EVENT_SENT) { OBD_FREE(ev->mem_desc.start, ev->mem_desc.length); - } else { + } else { // XXX make sure we understand all events, including ACK's - CERROR("Unknown event %d\n", ev->type); + CERROR("Unknown event %d\n", ev->type); LBUG(); } @@ -90,9 +85,9 @@ static int reply_in_callback(ptl_event_t *ev, void *data) rpc->rq_repmsg = ev->mem_desc.start + ev->offset; barrier(); wake_up_interruptible(&rpc->rq_wait_for_rep); - } else { + } else { // XXX make sure we understand all events, including ACK's - CERROR("Unknown event %d\n", ev->type); + CERROR("Unknown event %d\n", ev->type); LBUG(); } @@ -108,9 +103,9 @@ int request_in_callback(ptl_event_t *ev, void *data) CERROR("Warning: Possibly truncated rpc (%d/%d)\n", ev->mlength, ev->rlength); - spin_lock(&service->srv_lock); + spin_lock(&service->srv_lock); for (index = 0; index < service->srv_ring_length; index++) - if ( service->srv_buf[index] == ev->mem_desc.start) + if ( service->srv_buf[index] == ev->mem_desc.start) break; if (index == service->srv_ring_length) @@ -132,10 +127,10 @@ int request_in_callback(ptl_event_t *ev, void *data) ptl_set_inv_handle(&(service->srv_me_h[idx])); if (service->srv_ref_count[idx] == 0) - ptlrpc_link_svc_me(service, idx); + ptlrpc_link_svc_me(service, idx); } - spin_unlock(&service->srv_lock); + spin_unlock(&service->srv_lock); if (ev->type == PTL_EVENT_PUT) wake_up(&service->srv_waitq); else @@ -147,7 +142,6 @@ int request_in_callback(ptl_event_t *ev, void *data) static int bulk_source_callback(ptl_event_t *ev, void *data) { struct ptlrpc_bulk_desc *bulk = ev->mem_desc.user_ptr; - ENTRY; if (ev->type == PTL_EVENT_SENT) { @@ -161,14 +155,12 @@ static int bulk_source_callback(ptl_event_t *ev, void *data) LBUG(); } - EXIT; - return 1; + RETURN(1); } static int bulk_sink_callback(ptl_event_t *ev, void *data) { struct ptlrpc_bulk_desc *bulk = ev->mem_desc.user_ptr; - ENTRY; if (ev->type == PTL_EVENT_PUT) { @@ -187,8 +179,7 @@ static int bulk_sink_callback(ptl_event_t *ev, void *data) if (bulk->b_cb != NULL) ptlrpc_free_bulk(bulk); - EXIT; - return 1; + RETURN(1); } int ptlrpc_init_portals(void) -- 1.8.3.1