diff options
Diffstat (limited to 'fs/xfs/xfs_alloc.c')
| -rw-r--r-- | fs/xfs/xfs_alloc.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 9d1aeb7e2734..4f33c32affe3 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c | |||
| @@ -1074,13 +1074,13 @@ restart: | |||
| 1074 | * If we couldn't get anything, give up. | 1074 | * If we couldn't get anything, give up. |
| 1075 | */ | 1075 | */ |
| 1076 | if (bno_cur_lt == NULL && bno_cur_gt == NULL) { | 1076 | if (bno_cur_lt == NULL && bno_cur_gt == NULL) { |
| 1077 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | ||
| 1078 | |||
| 1077 | if (!forced++) { | 1079 | if (!forced++) { |
| 1078 | trace_xfs_alloc_near_busy(args); | 1080 | trace_xfs_alloc_near_busy(args); |
| 1079 | xfs_log_force(args->mp, XFS_LOG_SYNC); | 1081 | xfs_log_force(args->mp, XFS_LOG_SYNC); |
| 1080 | goto restart; | 1082 | goto restart; |
| 1081 | } | 1083 | } |
| 1082 | |||
| 1083 | xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); | ||
| 1084 | trace_xfs_alloc_size_neither(args); | 1084 | trace_xfs_alloc_size_neither(args); |
| 1085 | args->agbno = NULLAGBLOCK; | 1085 | args->agbno = NULLAGBLOCK; |
| 1086 | return 0; | 1086 | return 0; |
| @@ -2434,13 +2434,22 @@ xfs_alloc_vextent_worker( | |||
| 2434 | current_restore_flags_nested(&pflags, PF_FSTRANS); | 2434 | current_restore_flags_nested(&pflags, PF_FSTRANS); |
| 2435 | } | 2435 | } |
| 2436 | 2436 | ||
| 2437 | 2437 | /* | |
| 2438 | int /* error */ | 2438 | * Data allocation requests often come in with little stack to work on. Push |
| 2439 | * them off to a worker thread so there is lots of stack to use. Metadata | ||
| 2440 | * requests, OTOH, are generally from low stack usage paths, so avoid the | ||
| 2441 | * context switch overhead here. | ||
| 2442 | */ | ||
| 2443 | int | ||
| 2439 | xfs_alloc_vextent( | 2444 | xfs_alloc_vextent( |
| 2440 | xfs_alloc_arg_t *args) /* allocation argument structure */ | 2445 | struct xfs_alloc_arg *args) |
| 2441 | { | 2446 | { |
| 2442 | DECLARE_COMPLETION_ONSTACK(done); | 2447 | DECLARE_COMPLETION_ONSTACK(done); |
| 2443 | 2448 | ||
| 2449 | if (!args->userdata) | ||
| 2450 | return __xfs_alloc_vextent(args); | ||
| 2451 | |||
| 2452 | |||
| 2444 | args->done = &done; | 2453 | args->done = &done; |
| 2445 | INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); | 2454 | INIT_WORK_ONSTACK(&args->work, xfs_alloc_vextent_worker); |
| 2446 | queue_work(xfs_alloc_wq, &args->work); | 2455 | queue_work(xfs_alloc_wq, &args->work); |
