diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/recover.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/recover.c | 34 |
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/recover.c b/drivers/staging/lustre/lustre/ptlrpc/recover.c index db6626cab..30d9a164e 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/recover.c +++ b/drivers/staging/lustre/lustre/ptlrpc/recover.c @@ -107,14 +107,14 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight) /* Replay all the committed open requests on committed_list first */ if (!list_empty(&imp->imp_committed_list)) { tmp = imp->imp_committed_list.prev; - req = list_entry(tmp, struct ptlrpc_request, - rq_replay_list); + req = list_entry(tmp, struct ptlrpc_request, rq_replay_list); /* The last request on committed_list hasn't been replayed */ if (req->rq_transno > last_transno) { /* Since the imp_committed_list is immutable before * all of it's requests being replayed, it's safe to - * use a cursor to accelerate the search */ + * use a cursor to accelerate the search + */ imp->imp_replay_cursor = imp->imp_replay_cursor->next; while (imp->imp_replay_cursor != @@ -137,8 +137,9 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight) } /* All the requests in committed list have been replayed, let's replay - * the imp_replay_list */ - if (req == NULL) { + * the imp_replay_list + */ + if (!req) { list_for_each_safe(tmp, pos, &imp->imp_replay_list) { req = list_entry(tmp, struct ptlrpc_request, rq_replay_list); @@ -152,15 +153,16 @@ int ptlrpc_replay_next(struct obd_import *imp, int *inflight) /* If need to resend the last sent transno (because a reconnect * has occurred), then stop on the matching req and send it again. * If, however, the last sent transno has been committed then we - * continue replay from the next request. */ - if (req != NULL && imp->imp_resend_replay) + * continue replay from the next request. + */ + if (req && imp->imp_resend_replay) lustre_msg_add_flags(req->rq_reqmsg, MSG_RESENT); spin_lock(&imp->imp_lock); imp->imp_resend_replay = 0; spin_unlock(&imp->imp_lock); - if (req != NULL) { + if (req) { rc = ptlrpc_replay_req(req); if (rc) { CERROR("recovery replay error %d for req %llu\n", @@ -192,9 +194,8 @@ int ptlrpc_resend(struct obd_import *imp) return -1; } - list_for_each_entry_safe(req, next, &imp->imp_sending_list, - rq_list) { - LASSERTF((long)req > PAGE_CACHE_SIZE && req != LP_POISON, + list_for_each_entry_safe(req, next, &imp->imp_sending_list, rq_list) { + LASSERTF((long)req > PAGE_SIZE && req != LP_POISON, "req %p bad\n", req); LASSERTF(req->rq_type != LI_POISON, "req %p freed\n", req); if (!ptlrpc_no_resend(req)) @@ -249,7 +250,8 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req) } /* Wait for recovery to complete and resend. If evicted, then - this request will be errored out later.*/ + * this request will be errored out later. + */ spin_lock(&failed_req->rq_lock); if (!failed_req->rq_no_resend) failed_req->rq_resend = 1; @@ -260,7 +262,7 @@ void ptlrpc_request_handle_notconn(struct ptlrpc_request *failed_req) * Administratively active/deactive a client. * This should only be called by the ioctl interface, currently * - the lctl deactivate and activate commands - * - echo 0/1 >> /proc/osc/XXX/active + * - echo 0/1 >> /sys/fs/lustre/osc/XXX/active * - client umount -f (ll_umount_begin) */ int ptlrpc_set_import_active(struct obd_import *imp, int active) @@ -271,13 +273,15 @@ int ptlrpc_set_import_active(struct obd_import *imp, int active) LASSERT(obd); /* When deactivating, mark import invalid, and abort in-flight - * requests. */ + * requests. + */ if (!active) { LCONSOLE_WARN("setting import %s INACTIVE by administrator request\n", obd2cli_tgt(imp->imp_obd)); /* set before invalidate to avoid messages about imp_inval - * set without imp_deactive in ptlrpc_import_delay_req */ + * set without imp_deactive in ptlrpc_import_delay_req + */ spin_lock(&imp->imp_lock); imp->imp_deactive = 1; spin_unlock(&imp->imp_lock); |