From f45f09d9077c660925fb422f101d2025ee3f9f11 Mon Sep 17 00:00:00 2001 From: pschwan Date: Wed, 17 Apr 2002 17:39:07 +0000 Subject: [PATCH] The noncontroversial portion of the last few days of changes: - ENTRY/EXIT/RETURN cleanups - extraneous header file removal - made forgetting the 'setup' arguments in MDS/OST less fatal - added the connection and token to the CONNECT RPC, so that we can do the pointer/token connection trick now - fixed the 60 byte/-60 byte "leak" - added ptlrpc and ldlm setup to llmount.sh, llrmount.sh, -client, and -server --- lustre/include/linux/lustre_ha.h | 18 +++++- lustre/include/linux/lustre_lite.h | 8 ++- lustre/include/linux/lustre_net.h | 1 - lustre/include/linux/obd.h | 1 + lustre/ldlm/ldlm_extent.c | 8 --- lustre/ldlm/ldlm_resource.c | 13 +--- lustre/llite/rw.c | 3 +- lustre/llite/super.c | 47 ++++----------- lustre/mdc/mdc_request.c | 4 +- lustre/mds/handler.c | 3 + lustre/obdfilter/filter.c | 3 + lustre/ost/ost_handler.c | 14 ++--- lustre/ptlrpc/client.c | 3 +- lustre/ptlrpc/recovd.c | 120 +++++++++++++++++-------------------- lustre/ptlrpc/rpc.c | 19 ++---- lustre/ptlrpc/service.c | 13 ++-- lustre/tests/llmount-client.sh | 8 ++- lustre/tests/llmount-server.sh | 6 ++ lustre/tests/llmount.sh | 11 ++-- lustre/tests/llmountcleanup.sh | 3 + lustre/tests/llrmount.sh | 11 ++-- 21 files changed, 144 insertions(+), 173 deletions(-) diff --git a/lustre/include/linux/lustre_ha.h b/lustre/include/linux/lustre_ha.h index 3913e01..ba61536 100644 --- a/lustre/include/linux/lustre_ha.h +++ b/lustre/include/linux/lustre_ha.h @@ -1,6 +1,12 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + */ + #ifndef _LUSTRE_HA_H #define _LUSTRE_HA_H +#include + #define MGR_STOPPING 1 #define MGR_RUNNING 2 #define MGR_STOPPED 4 @@ -15,18 +21,24 @@ extern struct connmgr_obd *ptlrpc_connmgr; -struct connmgr_thread { +struct connmgr_thread { struct connmgr_obd *mgr; char *name; }; +struct connmgr_body { + __u64 conn; + __u64 conn_token; -struct connmgr_body { __u32 generation; }; -int connmgr_connect(struct connmgr_obd *mgr, struct ptlrpc_connection *cn); +int connmgr_connect(struct connmgr_obd *mgr, struct ptlrpc_connection *conn); +int connmgr_handle(struct obd_device *dev, struct ptlrpc_service *svc, + struct ptlrpc_request *req); void connmgr_cli_fail(struct ptlrpc_client *cli); void connmgr_cli_manage(struct connmgr_obd *mgr, struct ptlrpc_client *cli); +int recovd_setup(struct connmgr_obd *mgr); +int recovd_cleanup(struct connmgr_obd *mgr); #endif diff --git a/lustre/include/linux/lustre_lite.h b/lustre/include/linux/lustre_lite.h index cacdc83..bc43dc4 100644 --- a/lustre/include/linux/lustre_lite.h +++ b/lustre/include/linux/lustre_lite.h @@ -1,17 +1,20 @@ -/* object based disk file system +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * object based disk file system * * This code is issued under the GNU General Public License. * See the file COPYING in this distribution * * * - * #ifndef _LL_H #define _LL_H +#include #include #include @@ -99,4 +102,3 @@ void ll_sysctl_init(void); void ll_sysctl_clean(void); #endif - diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 4d60329..1dbc2ca 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -28,7 +28,6 @@ #include #include #include -#include /* FOO_REQUEST_PORTAL is for incoming requests on the FOO * FOO_REPLY_PORTAL is for incoming replies on the FOO diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index 0e80c8d..c2e5d4b 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -141,6 +141,7 @@ struct ost_obd { struct osc_obd { struct obd_device *osc_tgt; struct ptlrpc_client *osc_client; + struct ptlrpc_client *osc_ldlm_client; struct ptlrpc_connection *osc_conn; }; diff --git a/lustre/ldlm/ldlm_extent.c b/lustre/ldlm/ldlm_extent.c index ff5c512..e24a457 100644 --- a/lustre/ldlm/ldlm_extent.c +++ b/lustre/ldlm/ldlm_extent.c @@ -12,16 +12,8 @@ */ #define EXPORT_SYMTAB - -#include -#include -#include -#include - #define DEBUG_SUBSYSTEM S_LDLM -#include -#include #include /* This function will be called to judge if the granted queue of another child diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 157c89e..dc8e2c6 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -10,21 +10,12 @@ */ #define EXPORT_SYMTAB - -#include -#include -#include -#include - #define DEBUG_SUBSYSTEM S_LDLM -#include -#include - +#include #include -kmem_cache_t *ldlm_resource_slab; -kmem_cache_t *ldlm_lock_slab; +kmem_cache_t *ldlm_resource_slab, *ldlm_lock_slab; struct list_head ldlm_namespaces; spinlock_t ldlm_spinlock; diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 091887e..69ccf4c 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -191,8 +191,7 @@ static int ll_readpage(struct file *file, struct page *page) if (!PageLocked(page)) LBUG(); - if ( ((inode->i_size + PAGE_CACHE_SIZE -1)>>PAGE_SHIFT) - <= page->index) { + if (((inode->i_size + PAGE_CACHE_SIZE -1)>>PAGE_SHIFT) <= page->index) { memset(kmap(page), 0, PAGE_CACHE_SIZE); kunmap(page); GOTO(readpage_out, rc); diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 241ea28..6bc188c 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -16,25 +16,11 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include #define DEBUG_SUBSYSTEM S_LLITE #include +#include kmem_cache_t *ll_file_data_slab; extern struct address_space_operations ll_aops; @@ -50,26 +36,21 @@ static char *ll_read_opt(const char *opt, char *data) ENTRY; CDEBUG(D_INFO, "option: %s, data %s\n", opt, data); - if ( strncmp(opt, data, strlen(opt)) ) { - EXIT; - return NULL; - } - if ( (value = strchr(data, '=')) == NULL ) { - EXIT; - return NULL; - } + if ( strncmp(opt, data, strlen(opt)) ) + RETURN(NULL); + if ( (value = strchr(data, '=')) == NULL ) + RETURN(NULL); value++; OBD_ALLOC(retval, strlen(value) + 1); if ( !retval ) { CERROR("out of memory!\n"); - return NULL; + RETURN(NULL); } memcpy(retval, value, strlen(value)+1); CDEBUG(D_SUPER, "Assigned option: %s, value %s\n", opt, retval); - EXIT; - return retval; + RETURN(retval); } static void ll_options(char *options, char **dev, char **vers) @@ -135,8 +116,7 @@ static struct super_block * ll_read_super(struct super_block *sb, GOTO(out_free, sb = NULL); } - ptlrpc_init_client(ptlrpc_connmgr, - MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL, + ptlrpc_init_client(ptlrpc_connmgr, MDS_REQUEST_PORTAL, MDC_REPLY_PORTAL, &sbi->ll_mds_client); sbi->ll_mds_conn = ptlrpc_uuid_to_connection("mds"); @@ -290,8 +270,7 @@ int ll_inode_setattr(struct inode *inode, struct iattr *attr, int do_trunc) ptlrpc_free_req(request); - EXIT; - return err; + RETURN(err); } int ll_setattr(struct dentry *de, struct iattr *attr) @@ -303,19 +282,17 @@ static int ll_statfs(struct super_block *sb, struct statfs *buf) { struct statfs tmp; int err; - ENTRY; err = obd_statfs(ID(sb), &tmp); if ( err ) { CERROR("obd_statfs fails (%d)\n", err); - return err; + RETURN(err); } memcpy(buf, &tmp, sizeof(*buf)); CDEBUG(D_SUPER, "statfs returns avail %ld\n", tmp.f_bavail); - EXIT; - return err; + RETURN(err); } static void inline ll_to_inode(struct inode *dst, struct mds_body *body) @@ -393,9 +370,9 @@ static inline void ll_read_inode2(struct inode *inode, void *opaque) } else { init_special_inode(inode, inode->i_mode, ((int *)ll_i2info(inode)->lli_inline)[0]); + EXIT; } - EXIT; return; } diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 4ca7ad4..f4e7b50 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -223,7 +223,7 @@ int mdc_readpage(struct ptlrpc_client *cl, struct ptlrpc_connection *conn, static int request_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg) { - int err; + int err = 0; struct ptlrpc_client cl; struct ptlrpc_connection *conn; struct ptlrpc_request *request; @@ -262,7 +262,7 @@ static int request_ioctl(struct inode *inode, struct file *file, OBD_ALLOC(buf, PAGE_SIZE); if (!buf) { err = -ENOMEM; - break; + GOTO(out, err); } CERROR("-- readpage 0 for ino %lu\n", arg); err = mdc_readpage(&cl, conn, arg, S_IFDIR, 0, buf, &request); diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 652cf8f..2cb85ff 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -510,6 +510,9 @@ static int mds_setup(struct obd_device *obddev, obd_count len, void *buf) #ifdef CONFIG_DEV_RDONLY dev_clear_rdonly(2); #endif + if (!data->ioc_inlbuf1 || !data->ioc_inlbuf2) + RETURN(-EINVAL); + mds->mds_fstype = strdup(data->ioc_inlbuf2); if (!strcmp(mds->mds_fstype, "ext3")) diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 104e4da..cf579fb 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -270,6 +270,9 @@ static int filter_setup(struct obd_device *obddev, obd_count len, void *buf) int err = 0; ENTRY; + if (!data->ioc_inlbuf1 || !data->ioc_inlbuf2) + RETURN(-EINVAL); + MOD_INC_USE_COUNT; mnt = do_kern_mount(data->ioc_inlbuf2, 0, data->ioc_inlbuf1, NULL); err = PTR_ERR(mnt); diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index 47f2628..1a70c99 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -568,11 +568,8 @@ out: return 0; } - /* mount the file system (secretly) */ -static int ost_setup(struct obd_device *obddev, obd_count len, - void *buf) - +static int ost_setup(struct obd_device *obddev, obd_count len, void *buf) { struct obd_ioctl_data* data = buf; struct ost_obd *ost = &obddev->u.ost; @@ -580,14 +577,14 @@ static int ost_setup(struct obd_device *obddev, obd_count len, int err; ENTRY; - if (data->ioc_dev < 0 || data->ioc_dev > MAX_OBD_DEVICES) + if (data->ioc_dev < 0 || data->ioc_dev > MAX_OBD_DEVICES) RETURN(-ENODEV); MOD_INC_USE_COUNT; tgt = &obd_dev[data->ioc_dev]; ost->ost_tgt = tgt; - if ( ! (tgt->obd_flags & OBD_ATTACHED) || - ! (tgt->obd_flags & OBD_SET_UP) ){ + if (!(tgt->obd_flags & OBD_ATTACHED) || + !(tgt->obd_flags & OBD_SET_UP)) { CERROR("device not attached or not set up (%d)\n", data->ioc_dev); GOTO(error_dec, err = -EINVAL); @@ -609,9 +606,8 @@ static int ost_setup(struct obd_device *obddev, obd_count len, } err = ptlrpc_start_thread(obddev, ost->ost_service, "lustre_ost"); - if (err) { + if (err) GOTO(error_disc, err = -EINVAL); - } RETURN(0); diff --git a/lustre/ptlrpc/client.c b/lustre/ptlrpc/client.c index 23a3b9f..2be7a3c 100644 --- a/lustre/ptlrpc/client.c +++ b/lustre/ptlrpc/client.c @@ -24,8 +24,7 @@ #define DEBUG_SUBSYSTEM S_RPC -#include - +#include void ptlrpc_init_client(struct connmgr_obd *mgr, int req_portal, int rep_portal, struct ptlrpc_client *cl) diff --git a/lustre/ptlrpc/recovd.c b/lustre/ptlrpc/recovd.c index a663a44..cd7f4a2 100644 --- a/lustre/ptlrpc/recovd.c +++ b/lustre/ptlrpc/recovd.c @@ -15,50 +15,37 @@ */ #define EXPORT_SYMTAB - -#include -#include -#include -#include -#include -#include -#include -#include -#include - #define DEBUG_SUBSYSTEM S_RPC +#include #include #include -#include -#include -struct connmgr_obd *ptlrpc_connmgr; +struct connmgr_obd *ptlrpc_connmgr; void connmgr_cli_manage(struct connmgr_obd *mgr, struct ptlrpc_client *cli) { ENTRY; cli->cli_ha_mgr = mgr; spin_lock(&mgr->mgr_lock); - list_add(&cli->cli_ha_item, &mgr->mgr_connections_lh); - spin_unlock(&mgr->mgr_lock); + list_add(&cli->cli_ha_item, &mgr->mgr_connections_lh); + spin_unlock(&mgr->mgr_lock); EXIT; } - void connmgr_cli_fail(struct ptlrpc_client *cli) { ENTRY; - spin_lock(&cli->cli_ha_mgr->mgr_lock); + spin_lock(&cli->cli_ha_mgr->mgr_lock); cli->cli_ha_mgr->mgr_flags |= SVC_HA_EVENT; list_del(&cli->cli_ha_item); - list_add(&cli->cli_ha_item, &cli->cli_ha_mgr->mgr_troubled_lh); - spin_unlock(&cli->cli_ha_mgr->mgr_lock); + list_add(&cli->cli_ha_item, &cli->cli_ha_mgr->mgr_troubled_lh); + spin_unlock(&cli->cli_ha_mgr->mgr_lock); wake_up(&cli->cli_ha_mgr->mgr_waitq); EXIT; } -int connmgr_upcall(void) +static int connmgr_upcall(void) { char *argv[2]; char *envp[3]; @@ -82,8 +69,7 @@ static void connmgr_unpack_body(struct ptlrpc_request *req) b->generation = NTOH__u32(b->generation); } -int connmgr_connect(struct connmgr_obd *mgr, - struct ptlrpc_connection *conn) +int connmgr_connect(struct connmgr_obd *mgr, struct ptlrpc_connection *conn) { struct ptlrpc_request *req; struct ptlrpc_client *cl; @@ -91,8 +77,8 @@ int connmgr_connect(struct connmgr_obd *mgr, int rc, size = sizeof(*body); ENTRY; - if (!mgr) { - CERROR("no manager\n"); + if (!mgr) { + CERROR("no manager\n"); LBUG(); } cl = mgr->mgr_client; @@ -103,25 +89,28 @@ int connmgr_connect(struct connmgr_obd *mgr, body = lustre_msg_buf(req->rq_reqmsg, 0); body->generation = HTON__u32(conn->c_generation); + body->conn = (__u64)(unsigned long)conn; + body->conn_token = conn->c_token; req->rq_replen = lustre_msg_size(1, &size); rc = ptlrpc_queue_wait(req); rc = ptlrpc_check_status(req, rc); - if (!rc) { connmgr_unpack_body(req); body = lustre_msg_buf(req->rq_repmsg, 0); CDEBUG(D_NET, "mode: %o\n", body->generation); + conn->c_remote_conn = body->conn; + conn->c_remote_token = body->conn_token; } + ptlrpc_free_req(req); EXIT; out: return rc; } - -int connmgr_handle_connect(struct ptlrpc_request *req) +static int connmgr_handle_connect(struct ptlrpc_request *req) { struct connmgr_body *body; int rc, size = sizeof(*body); @@ -135,36 +124,41 @@ int connmgr_handle_connect(struct ptlrpc_request *req) } body = lustre_msg_buf(req->rq_reqmsg, 0); - connmgr_unpack_body(req); + connmgr_unpack_body(req); + + req->rq_connection->c_remote_conn = body->conn; + req->rq_connection->c_remote_token = body->conn_token; - printk("incoming generation %d\n", body->generation); + CERROR("incoming generation %d\n", body->generation); body = lustre_msg_buf(req->rq_repmsg, 0); body->generation = 4711; + body->conn = (__u64)(unsigned long)req->rq_connection; + body->conn_token = req->rq_connection->c_token; + RETURN(0); } -int connmgr_handle(struct obd_device *dev, - struct ptlrpc_service *svc, +int connmgr_handle(struct obd_device *dev, struct ptlrpc_service *svc, struct ptlrpc_request *req) { int rc; ENTRY; rc = lustre_unpack_msg(req->rq_reqmsg, req->rq_reqlen); - if (rc) { - CERROR("lustre_mds: Invalid request\n"); + if (rc) { + CERROR("Invalid request\n"); GOTO(out, rc); } if (req->rq_reqmsg->type != PTL_RPC_REQUEST) { - CERROR("lustre_mds: wrong packet type sent %d\n", + CERROR("wrong packet type sent %d\n", req->rq_reqmsg->type); GOTO(out, rc = -EINVAL); } switch (req->rq_reqmsg->opc) { case CONNMGR_CONNECT: - CDEBUG(D_INODE, "getattr\n"); + CDEBUG(D_INODE, "connect\n"); OBD_FAIL_RETURN(OBD_FAIL_MDS_GETATTR_NET, 0); rc = connmgr_handle_connect(req); break; @@ -186,68 +180,65 @@ out: return 0; } - static int recovd_check_event(struct connmgr_obd *mgr) { - int rc = 0; + int rc = 0; ENTRY; spin_lock(&mgr->mgr_lock); - if (!(mgr->mgr_flags & MGR_WORKING) && - !list_empty(&mgr->mgr_troubled_lh) ) { + if (!(mgr->mgr_flags & MGR_WORKING) && + !list_empty(&mgr->mgr_troubled_lh)) { - CERROR("connection in trouble - state: WORKING, upcall\n"); + CERROR("connection in trouble - state: WORKING, upcall\n"); mgr->mgr_flags = MGR_WORKING; - mgr->mgr_waketime = CURRENT_TIME; + mgr->mgr_waketime = CURRENT_TIME; mgr->mgr_timeout = 5 * HZ; - schedule_timeout(mgr->mgr_timeout); + schedule_timeout(mgr->mgr_timeout); } if (mgr->mgr_flags & MGR_WORKING && - CURRENT_TIME <= mgr->mgr_waketime + mgr->mgr_timeout ) { + CURRENT_TIME <= mgr->mgr_waketime + mgr->mgr_timeout) { CERROR("WORKING: new event\n"); - mgr->mgr_waketime = CURRENT_TIME; - schedule_timeout(mgr->mgr_timeout); + mgr->mgr_waketime = CURRENT_TIME; + schedule_timeout(mgr->mgr_timeout); } - if (mgr->mgr_flags & MGR_STOPPING) { + if (mgr->mgr_flags & MGR_STOPPING) { CERROR("ha mgr stopping\n"); rc = 1; } - spin_unlock(&mgr->mgr_lock); + spin_unlock(&mgr->mgr_lock); RETURN(rc); } -int recovd_handle_event(struct connmgr_obd *mgr) +static int recovd_handle_event(struct connmgr_obd *mgr) { - spin_lock(&mgr->mgr_lock); - if (!(mgr->mgr_flags & MGR_WORKING) && - !list_empty(&mgr->mgr_troubled_lh) ) { + if (!(mgr->mgr_flags & MGR_WORKING) && + !list_empty(&mgr->mgr_troubled_lh)) { - CERROR("connection in trouble - state: WORKING, upcall\n"); + CERROR("connection in trouble - state: WORKING, upcall\n"); mgr->mgr_flags = MGR_WORKING; connmgr_upcall(); - mgr->mgr_waketime = CURRENT_TIME; + mgr->mgr_waketime = CURRENT_TIME; mgr->mgr_timeout = 5 * HZ; - schedule_timeout(mgr->mgr_timeout); - + schedule_timeout(mgr->mgr_timeout); } if (mgr->mgr_flags & MGR_WORKING && - CURRENT_TIME <= mgr->mgr_waketime + mgr->mgr_timeout ) { + CURRENT_TIME <= mgr->mgr_waketime + mgr->mgr_timeout) { CERROR("WORKING: new event\n"); - mgr->mgr_waketime = CURRENT_TIME; - schedule_timeout(mgr->mgr_timeout); + mgr->mgr_waketime = CURRENT_TIME; + schedule_timeout(mgr->mgr_timeout); } spin_unlock(&mgr->mgr_lock); @@ -277,18 +268,18 @@ static int recovd_main(void *arg) /* And now, loop forever on requests */ while (1) { - wait_event_interruptible(mgr->mgr_waitq, + wait_event_interruptible(mgr->mgr_waitq, recovd_check_event(mgr)); spin_lock(&mgr->mgr_lock); if (mgr->mgr_flags & MGR_STOPPING) { spin_unlock(&mgr->mgr_lock); - CERROR("lustre_hamgr quitting\n"); + CERROR("lustre_hamgr quitting\n"); EXIT; break; } - recovd_handle_event(mgr); + recovd_handle_event(mgr); spin_unlock(&mgr->mgr_lock); } @@ -307,7 +298,7 @@ int recovd_setup(struct connmgr_obd *mgr) INIT_LIST_HEAD(&mgr->mgr_connections_lh); INIT_LIST_HEAD(&mgr->mgr_troubled_lh); - spin_lock_init(&mgr->mgr_lock); + spin_lock_init(&mgr->mgr_lock); d.mgr = mgr; d.name = "lustre_recovd"; @@ -323,10 +314,9 @@ int recovd_setup(struct connmgr_obd *mgr) } wait_event(mgr->mgr_ctl_waitq, mgr->mgr_flags & MGR_RUNNING); - RETURN(0); + RETURN(0); } - int recovd_cleanup(struct connmgr_obd *mgr) { mgr->mgr_flags = MGR_STOPPING; diff --git a/lustre/ptlrpc/rpc.c b/lustre/ptlrpc/rpc.c index 67c988f..e1bc4fc 100644 --- a/lustre/ptlrpc/rpc.c +++ b/lustre/ptlrpc/rpc.c @@ -26,19 +26,11 @@ #define DEBUG_SUBSYSTEM S_RPC -#include - -extern int connmgr_handle(struct obd_device *dev, - struct ptlrpc_service *svc, - struct ptlrpc_request *req); +#include extern int ptlrpc_init_portals(void); extern void ptlrpc_exit_portals(void); -extern int recovd_setup(struct connmgr_obd *mgr); -extern int recovd_cleanup(struct connmgr_obd *mgr); - - int connmgr_setup(struct obd_device *obddev, obd_count len, void *buf) { struct connmgr_obd *mgr = &obddev->u.mgr; @@ -55,9 +47,9 @@ int connmgr_setup(struct obd_device *obddev, obd_count len, void *buf) if (err) GOTO(err_free, err); - mgr->mgr_service = ptlrpc_init_svc - (128 * 1024,CONNMGR_REQUEST_PORTAL, CONNMGR_REPLY_PORTAL, - "self", connmgr_handle); + mgr->mgr_service = + ptlrpc_init_svc(128 * 1024,CONNMGR_REQUEST_PORTAL, + CONNMGR_REPLY_PORTAL, "self", connmgr_handle); if (!mgr->mgr_service) { CERROR("failed to start service\n"); GOTO(err_recovd, err = -EINVAL); @@ -86,7 +78,6 @@ int connmgr_setup(struct obd_device *obddev, obd_count len, void *buf) RETURN(err); } - int connmgr_cleanup(struct obd_device *dev) { struct connmgr_obd *mgr = &dev->u.mgr; @@ -106,7 +97,7 @@ int connmgr_cleanup(struct obd_device *dev) OBD_FREE(mgr->mgr_service, sizeof(*mgr->mgr_service)); mgr->mgr_flags = MGR_STOPPING; - PORTAL_FREE(mgr->mgr_client, sizeof(*mgr->mgr_client)); + OBD_FREE(mgr->mgr_client, sizeof(*mgr->mgr_client)); MOD_DEC_USE_COUNT; RETURN(0); } diff --git a/lustre/ptlrpc/service.c b/lustre/ptlrpc/service.c index afe230d..5a23889 100644 --- a/lustre/ptlrpc/service.c +++ b/lustre/ptlrpc/service.c @@ -21,18 +21,17 @@ */ #define EXPORT_SYMTAB - #define DEBUG_SUBSYSTEM S_RPC #include extern int request_in_callback(ptl_event_t *ev, void *data); extern int ptl_handled_rpc(struct ptlrpc_service *service, void *start); -extern int connmgr_handle_event(struct obd_device *dev, struct ptlrpc_service *); static int ptlrpc_check_event(struct ptlrpc_service *svc) { int rc = 0; + ENTRY; spin_lock(&svc->srv_lock); if (sigismember(&(current->pending.signal), SIGKILL) || @@ -75,6 +74,7 @@ ptlrpc_init_svc(__u32 bufsize, int req_portal, int rep_portal, char *uuid, int err; int rc, i; struct ptlrpc_service *service; + ENTRY; OBD_ALLOC(service, sizeof(*service)); if (!service) { @@ -105,8 +105,7 @@ ptlrpc_init_svc(__u32 bufsize, int req_portal, int rep_portal, char *uuid, service->srv_id.nid = PTL_ID_ANY; service->srv_id.pid = PTL_ID_ANY; - rc = PtlEQAlloc(service->srv_self.peer_ni, 128, - request_in_callback, + rc = PtlEQAlloc(service->srv_self.peer_ni, 128, request_in_callback, service, &(service->srv_eq_h)); if (rc != PTL_OK) { @@ -129,7 +128,7 @@ ptlrpc_init_svc(__u32 bufsize, int req_portal, int rep_portal, char *uuid, CDEBUG(D_NET, "Starting service listening on portal %d\n", service->srv_req_portal); - return service; + RETURN(service); err_ring: service->srv_ring_length = i; rpc_unregister_service(service); // XXX verify this is right @@ -166,10 +165,6 @@ static int handle_incoming_request(struct obd_device *obddev, * We don't know how to find that from here. */ peer.peer_ni = svc->srv_self.peer_ni; - /* FIXME: rq_reqmsg->conn should be, if nonzero, the local connection - * structure. Until we have the HA connect messages that we talked - * about, however, we don't have a way to exchange that address/token - * pair and this will always be zero. */ if (request.rq_reqmsg->conn) { request.rq_connection = (void *)(unsigned long)request.rq_reqmsg->conn; diff --git a/lustre/tests/llmount-client.sh b/lustre/tests/llmount-client.sh index ec535d4..67c7f0c 100644 --- a/lustre/tests/llmount-client.sh +++ b/lustre/tests/llmount-client.sh @@ -14,9 +14,15 @@ setup_lustre $OBDCTL <