Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Orangefs: code sanitation.

Signed-off-by: Mike Marshall <hubcap@omnibond.com>

+46 -29
+10 -10
fs/orangefs/devorangefs-req.c
··· 46 46 list_add_tail(&op->list, &htable_ops_in_progress[index]); 47 47 } 48 48 49 + /* 50 + * find the op with this tag and remove it from the in progress 51 + * hash table. 52 + */ 49 53 static struct orangefs_kernel_op_s *orangefs_devreq_remove_op(__u64 tag) 50 54 { 51 55 struct orangefs_kernel_op_s *op, *next; ··· 194 190 return -EAGAIN; 195 191 } 196 192 197 - gossip_debug(GOSSIP_DEV_DEBUG, "orangefs: reading op tag %llu %s\n", 198 - llu(cur_op->tag), get_opname_string(cur_op)); 193 + gossip_debug(GOSSIP_DEV_DEBUG, "%s: reading op tag %llu %s\n", 194 + __func__, 195 + llu(cur_op->tag), 196 + get_opname_string(cur_op)); 199 197 200 198 /* 201 199 * Such an op should never be on the list in the first place. If so, we ··· 210 204 spin_unlock(&orangefs_request_list_lock); 211 205 return -EAGAIN; 212 206 } 207 + 213 208 list_del_init(&cur_op->list); 214 209 spin_unlock(&orangefs_request_list_lock); 215 210 ··· 330 323 return -EPROTO; 331 324 } 332 325 326 + /* remove the op from the in progress hash table */ 333 327 op = orangefs_devreq_remove_op(head.tag); 334 328 if (!op) { 335 329 gossip_err("WARNING: No one's waiting for tag %llu\n", ··· 494 486 gossip_debug(GOSSIP_DEV_DEBUG, "ORANGEFS Device Close: Filesystem(s) %s\n", 495 487 (unmounted ? "UNMOUNTED" : "MOUNTED")); 496 488 497 - /* 498 - * Walk through the list of ops in the request list, mark them 499 - * as purged and wake them up. 500 - */ 501 489 purge_waiting_ops(); 502 - /* 503 - * Walk through the hash table of in progress operations; mark 504 - * them as purged and wake them up 505 - */ 506 490 purge_inprogress_ops(); 507 491 508 492 orangefs_bufmap_run_down();
+6 -5
fs/orangefs/orangefs-mod.c
··· 119 119 if (gossip_debug_mask != 0) 120 120 kernel_mask_set_mod_init = true; 121 121 122 - /* print information message to the system log */ 123 - pr_info("orangefs: orangefs_init called with debug mask: :%s: :%llx:\n", 124 - kernel_debug_string, 125 - (unsigned long long)gossip_debug_mask); 122 + pr_info("%s: called with debug mask: :%s: :%llx:\n", 123 + __func__, 124 + kernel_debug_string, 125 + (unsigned long long)gossip_debug_mask); 126 126 127 127 ret = bdi_init(&orangefs_backing_dev_info); 128 128 ··· 147 147 /* Initialize the orangefsdev subsystem. */ 148 148 ret = orangefs_dev_init(); 149 149 if (ret < 0) { 150 - gossip_err("orangefs: could not initialize device subsystem %d!\n", 150 + gossip_err("%s: could not initialize device subsystem %d!\n", 151 + __func__, 151 152 ret); 152 153 goto cleanup_inode; 153 154 }
+30 -14
fs/orangefs/waitqueue.c
··· 75 75 76 76 /* 77 77 * If ORANGEFS_OP_NO_MUTEX was set in flags, we need to avoid 78 - * aquiring the request_mutex because we're servicing a 78 + * acquiring the request_mutex because we're servicing a 79 79 * high priority remount operation and the request_mutex is 80 80 * already taken. 81 81 */ ··· 91 91 if (ret < 0) { 92 92 op->downcall.status = ret; 93 93 gossip_debug(GOSSIP_WAIT_DEBUG, 94 - "orangefs: service_operation interrupted.\n"); 94 + "%s: service_operation interrupted.\n", 95 + __func__); 95 96 return ret; 96 97 } 97 98 } ··· 128 127 ret, 129 128 op); 130 129 130 + /* got matching downcall; make sure status is in errno format */ 131 131 if (!ret) { 132 132 spin_unlock(&op->lock); 133 - /* got matching downcall; make sure status is in errno format */ 134 133 op->downcall.status = 135 134 orangefs_normalize_to_errno(op->downcall.status); 136 135 ret = op->downcall.status; ··· 145 144 } 146 145 147 146 /* 148 - * remove waiting ops from the request list or 149 - * remove in-progress ops from the in-progress list. 147 + * remove a waiting op from the request list or 148 + * remove an in-progress op from the in-progress list. 150 149 */ 151 150 orangefs_clean_up_interrupted_operation(op); 152 151 ··· 180 179 return ret; 181 180 } 182 181 182 + /* This can get called on an I/O op if it had a bad service_operation. */ 183 183 bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op) 184 184 { 185 185 u64 tag = op->tag; ··· 208 206 spin_unlock(&op->lock); 209 207 spin_unlock(&orangefs_request_list_lock); 210 208 211 - gossip_debug(GOSSIP_UTILS_DEBUG, 209 + gossip_debug(GOSSIP_WAIT_DEBUG, 212 210 "Attempting ORANGEFS operation cancellation of tag %llu\n", 213 211 llu(tag)); 214 212 return true; 215 213 } 216 214 217 - static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) 215 + /* 216 + * Change an op to the "given up" state and remove it from its list. 217 + */ 218 + static void 219 + orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) 218 220 { 219 221 /* 220 222 * handle interrupted cases depending on what state we were in when 221 - * the interruption is detected. there is a coarse grained lock 222 - * across the operation. 223 + * the interruption is detected. 223 224 * 224 225 * Called with op->lock held. 225 226 */ 227 + 228 + /* 229 + * List manipulation code elsewhere will ignore ops that 230 + * have been given up upon. 231 + */ 226 232 op->op_state |= OP_VFS_STATE_GIVEN_UP; 227 - /* from that point on it can't be moved by anybody else */ 233 + 228 234 if (list_empty(&op->list)) { 229 235 /* caught copying to/from daemon */ 230 236 BUG_ON(op_state_serviced(op)); ··· 269 259 } 270 260 271 261 /* 272 - * sleeps on waitqueue waiting for matching downcall. 273 - * if client-core finishes servicing, then we are good to go. 262 + * Sleeps on waitqueue waiting for matching downcall. 263 + * If client-core finishes servicing, then we are good to go. 274 264 * else if client-core exits, we get woken up here, and retry with a timeout 275 265 * 276 - * Post when this call returns to the caller, the specified op will no 277 - * longer be on any list or htable. 266 + * When this call returns to the caller, the specified op will no 267 + * longer be in either the in_progress hash table or on the request list. 278 268 * 279 269 * Returns 0 on success and -errno on failure 280 270 * Errors are: ··· 291 281 { 292 282 long n; 293 283 284 + /* 285 + * There's a "schedule_timeout" inside of these wait 286 + * primitives, during which the op is out of the hands of the 287 + * user process that needs something done and is being 288 + * manipulated by the client-core process. 289 + */ 294 290 if (interruptible) 295 291 n = wait_for_completion_interruptible_timeout(&op->waitq, 296 292 timeout);