| .. | .. |
|---|
| 19 | 19 | |
|---|
| 20 | 20 | static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, |
|---|
| 21 | 21 | long timeout, |
|---|
| 22 | | - bool interruptible) |
|---|
| 22 | + int flags) |
|---|
| 23 | 23 | __acquires(op->lock); |
|---|
| 24 | 24 | static void orangefs_clean_up_interrupted_operation(struct orangefs_kernel_op_s *op) |
|---|
| 25 | 25 | __releases(op->lock); |
|---|
| .. | .. |
|---|
| 143 | 143 | if (!(flags & ORANGEFS_OP_NO_MUTEX)) |
|---|
| 144 | 144 | mutex_unlock(&orangefs_request_mutex); |
|---|
| 145 | 145 | |
|---|
| 146 | | - ret = wait_for_matching_downcall(op, timeout, |
|---|
| 147 | | - flags & ORANGEFS_OP_INTERRUPTIBLE); |
|---|
| 148 | | - |
|---|
| 146 | + ret = wait_for_matching_downcall(op, timeout, flags); |
|---|
| 149 | 147 | gossip_debug(GOSSIP_WAIT_DEBUG, |
|---|
| 150 | 148 | "%s: wait_for_matching_downcall returned %d for %p\n", |
|---|
| 151 | 149 | __func__, |
|---|
| .. | .. |
|---|
| 319 | 317 | */ |
|---|
| 320 | 318 | static int wait_for_matching_downcall(struct orangefs_kernel_op_s *op, |
|---|
| 321 | 319 | long timeout, |
|---|
| 322 | | - bool interruptible) |
|---|
| 320 | + int flags) |
|---|
| 323 | 321 | __acquires(op->lock) |
|---|
| 324 | 322 | { |
|---|
| 325 | 323 | long n; |
|---|
| 324 | + int writeback = flags & ORANGEFS_OP_WRITEBACK, |
|---|
| 325 | + interruptible = flags & ORANGEFS_OP_INTERRUPTIBLE; |
|---|
| 326 | 326 | |
|---|
| 327 | 327 | /* |
|---|
| 328 | 328 | * There's a "schedule_timeout" inside of these wait |
|---|
| .. | .. |
|---|
| 330 | 330 | * user process that needs something done and is being |
|---|
| 331 | 331 | * manipulated by the client-core process. |
|---|
| 332 | 332 | */ |
|---|
| 333 | | - if (interruptible) |
|---|
| 333 | + if (writeback) |
|---|
| 334 | + n = wait_for_completion_io_timeout(&op->waitq, timeout); |
|---|
| 335 | + else if (!writeback && interruptible) |
|---|
| 334 | 336 | n = wait_for_completion_interruptible_timeout(&op->waitq, |
|---|
| 335 | | - timeout); |
|---|
| 336 | | - else |
|---|
| 337 | + timeout); |
|---|
| 338 | + else /* !writeback && !interruptible but compiler complains */ |
|---|
| 337 | 339 | n = wait_for_completion_killable_timeout(&op->waitq, timeout); |
|---|
| 338 | 340 | |
|---|
| 339 | 341 | spin_lock(&op->lock); |
|---|