···4646 list_add_tail(&op->list, &htable_ops_in_progress[index]);4747}48484949+/*5050+ * find the op with this tag and remove it from the in progress5151+ * hash table.5252+ */4953static struct orangefs_kernel_op_s *orangefs_devreq_remove_op(__u64 tag)5054{5155 struct orangefs_kernel_op_s *op, *next;···194190 return -EAGAIN;195191 }196192197197- gossip_debug(GOSSIP_DEV_DEBUG, "orangefs: reading op tag %llu %s\n",198198- llu(cur_op->tag), get_opname_string(cur_op));193193+ gossip_debug(GOSSIP_DEV_DEBUG, "%s: reading op tag %llu %s\n",194194+ __func__,195195+ llu(cur_op->tag),196196+ get_opname_string(cur_op));199197200198 /*201199 * Such an op should never be on the list in the first place. If so, we···210204 spin_unlock(&orangefs_request_list_lock);211205 return -EAGAIN;212206 }207207+213208 list_del_init(&cur_op->list);214209 spin_unlock(&orangefs_request_list_lock);215210···330323 return -EPROTO;331324 }332325326326+ /* remove the op from the in progress hash table */333327 op = orangefs_devreq_remove_op(head.tag);334328 if (!op) {335329 gossip_err("WARNING: No one's waiting for tag %llu\n",···494486 gossip_debug(GOSSIP_DEV_DEBUG, "ORANGEFS Device Close: Filesystem(s) %s\n",495487 (unmounted ? "UNMOUNTED" : "MOUNTED"));496488497497- /*498498- * Walk through the list of ops in the request list, mark them499499- * as purged and wake them up.500500- */501489 purge_waiting_ops();502502- /*503503- * Walk through the hash table of in progress operations; mark504504- * them as purged and wake them up505505- */506490 purge_inprogress_ops();507491508492 orangefs_bufmap_run_down();
+6-5
fs/orangefs/orangefs-mod.c
···119119 if (gossip_debug_mask != 0)120120 kernel_mask_set_mod_init = true;121121122122- /* print information message to the system log */123123- pr_info("orangefs: orangefs_init called with debug mask: :%s: :%llx:\n",124124- kernel_debug_string,125125- (unsigned long long)gossip_debug_mask);122122+ pr_info("%s: called with debug mask: :%s: :%llx:\n",123123+ __func__,124124+ kernel_debug_string,125125+ (unsigned long long)gossip_debug_mask);126126127127 ret = bdi_init(&orangefs_backing_dev_info);128128···147147 /* Initialize the orangefsdev subsystem. */148148 ret = orangefs_dev_init();149149 if (ret < 0) {150150- gossip_err("orangefs: could not initialize device subsystem %d!\n",150150+ gossip_err("%s: could not initialize device subsystem %d!\n",151151+ __func__,151152 ret);152153 goto cleanup_inode;153154 }
+30-14
fs/orangefs/waitqueue.c
···75757676 /*7777 * If ORANGEFS_OP_NO_MUTEX was set in flags, we need to avoid7878- * aquiring the request_mutex because we're servicing a7878+ * acquiring the request_mutex because we're servicing a7979 * high priority remount operation and the request_mutex is8080 * already taken.8181 */···9191 if (ret < 0) {9292 op->downcall.status = ret;9393 gossip_debug(GOSSIP_WAIT_DEBUG,9494- "orangefs: service_operation interrupted.\n");9494+ "%s: service_operation interrupted.\n",9595+ __func__);9596 return ret;9697 }9798 }···128127 ret,129128 op);130129130130+ /* got matching downcall; make sure status is in errno format */131131 if (!ret) {132132 spin_unlock(&op->lock);133133- /* got matching downcall; make sure status is in errno format */134133 op->downcall.status =135134 orangefs_normalize_to_errno(op->downcall.status);136135 ret = op->downcall.status;···145144 }146145147146 /*148148- * remove waiting ops from the request list or149149- * remove in-progress ops from the in-progress list.147147+ * remove a waiting op from the request list or148148+ * remove an in-progress op from the in-progress list.150149 */151150 orangefs_clean_up_interrupted_operation(op);152151···180179 return ret;181180}182181182182+/* This can get called on an I/O op if it had a bad service_operation. */183183bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op)184184{185185 u64 tag = op->tag;···208206 spin_unlock(&op->lock);209207 spin_unlock(&orangefs_request_list_lock);210208211211- gossip_debug(GOSSIP_UTILS_DEBUG,209209+ gossip_debug(GOSSIP_WAIT_DEBUG,212210 "Attempting ORANGEFS operation cancellation of tag %llu\n",213211 llu(tag));214212 return true;215213}216214217217-static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op)215215+/*216216+ * Change an op to the "given up" state and remove it from its list.217217+ */218218+static void219219+ orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op)218220{219221 /*220222 * handle interrupted cases depending on what state we were in when221221- * the interruption is detected. there is a coarse grained lock222222- * across the operation.223223+ * the interruption is detected.223224 *224225 * Called with op->lock held.225226 */227227+228228+ /*229229+ * List manipulation code elsewhere will ignore ops that230230+ * have been given up upon.231231+ */226232 op->op_state |= OP_VFS_STATE_GIVEN_UP;227227- /* from that point on it can't be moved by anybody else */233233+228234 if (list_empty(&op->list)) {229235 /* caught copying to/from daemon */230236 BUG_ON(op_state_serviced(op));···269259}270260271261/*272272- * sleeps on waitqueue waiting for matching downcall.273273- * if client-core finishes servicing, then we are good to go.262262+ * Sleeps on waitqueue waiting for matching downcall.263263+ * If client-core finishes servicing, then we are good to go.274264 * else if client-core exits, we get woken up here, and retry with a timeout275265 *276276- * Post when this call returns to the caller, the specified op will no277277- * longer be on any list or htable.266266+ * When this call returns to the caller, the specified op will no267267+ * longer be in either the in_progress hash table or on the request list.278268 *279269 * Returns 0 on success and -errno on failure280270 * Errors are:···291281{292282 long n;293283284284+ /*285285+ * There's a "schedule_timeout" inside of these wait286286+ * primitives, during which the op is out of the hands of the287287+ * user process that needs something done and is being288288+ * manipulated by the client-core process.289289+ */294290 if (interruptible)295291 n = wait_for_completion_interruptible_timeout(&op->waitq,296292 timeout);