From: adilger Date: Thu, 20 Jun 2002 18:27:12 +0000 (+0000) Subject: Merge from posix_stable. X-Git-Tag: 0.4.2~112 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d826aa6a3c9db8585bdf92cda4878a6ac729ecdd;p=fs%2Flustre-release.git Merge from posix_stable. --- diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index a149d3f..8ecb2c9 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -356,61 +356,46 @@ static int ldlm_iocontrol(long cmd, struct obd_conn *conn, int len, void *karg, return err; } +#define LDLM_NUM_THREADS 8 + static int ldlm_setup(struct obd_device *obddev, obd_count len, void *buf) { struct ldlm_obd *ldlm = &obddev->u.ldlm; - int err; + int rc; + int i; ENTRY; + MOD_INC_USE_COUNT; ldlm->ldlm_service = ptlrpc_init_svc(64 * 1024, LDLM_REQUEST_PORTAL, LDLM_REPLY_PORTAL, "self", lustre_handle); - if (!ldlm->ldlm_service) - LBUG(); - - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); - } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); - } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); - } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); - } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); + if (!ldlm->ldlm_service) { LBUG(); + GOTO(out_dec, rc = -ENOMEM); } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); - } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); - } - err = ptlrpc_start_thread(obddev, ldlm->ldlm_service, "lustre_dlm"); - if (err) { - CERROR("cannot start thread\n"); - LBUG(); + + for (i = 0; i < LDLM_NUM_THREADS; i++) { + rc = ptlrpc_start_thread(obddev, ldlm->ldlm_service, + "lustre_dlm"); + /* XXX We could just continue if we had started at least + * a few threads here. + */ + if (rc) { + CERROR("cannot start LDLM thread #%d: rc %d\n", i, rc); + LBUG(); + GOTO(out_thread, rc); + } } - MOD_INC_USE_COUNT; RETURN(0); + +out_thread: + ptlrpc_stop_all_threads(ldlm->ldlm_service); + rpc_unregister_service(ldlm->ldlm_service); + OBD_FREE(ldlm->ldlm_service, sizeof(*ldlm->ldlm_service)); +out_dec: + MOD_DEC_USE_COUNT; + return rc; } static int ldlm_cleanup(struct obd_device *obddev) diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index ffb3696..6f2e813 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -347,7 +347,7 @@ static inline void ext2_set_de_type(ext2_dirent *de, struct inode *inode) } int -new_ll_readdir (struct file * filp, void * dirent, filldir_t filldir) +ll_readdir (struct file * filp, void * dirent, filldir_t filldir) { loff_t pos = filp->f_pos; struct inode *inode = filp->f_dentry->d_inode; @@ -710,5 +710,5 @@ not_empty: struct file_operations ll_dir_operations = { read: generic_read_dir, - readdir: new_ll_readdir + readdir: ll_readdir };