.. | .. |
---|
56 | 56 | /* waitqueue head for events */ |
---|
57 | 57 | wait_queue_head_t event_wqh; |
---|
58 | 58 | /* a refile sequence protected by fault_pending_wqh lock */ |
---|
59 | | - struct seqcount refile_seq; |
---|
| 59 | + seqlock_t refile_seq; |
---|
60 | 60 | /* pseudo fd refcounting */ |
---|
61 | 61 | atomic_t refcount; |
---|
62 | 62 | /* userfaultfd syscall flags */ |
---|
.. | .. |
---|
1060 | 1060 | * waitqueue could become empty if this is the |
---|
1061 | 1061 | * only userfault. |
---|
1062 | 1062 | */ |
---|
1063 | | - write_seqcount_begin(&ctx->refile_seq); |
---|
| 1063 | + write_seqlock(&ctx->refile_seq); |
---|
1064 | 1064 | |
---|
1065 | 1065 | /* |
---|
1066 | 1066 | * The fault_pending_wqh.lock prevents the uwq |
---|
.. | .. |
---|
1086 | 1086 | list_del(&uwq->wq.entry); |
---|
1087 | 1087 | add_wait_queue(&ctx->fault_wqh, &uwq->wq); |
---|
1088 | 1088 | |
---|
1089 | | - write_seqcount_end(&ctx->refile_seq); |
---|
| 1089 | + write_sequnlock(&ctx->refile_seq); |
---|
1090 | 1090 | |
---|
1091 | 1091 | /* careful to always initialize msg if ret == 0 */ |
---|
1092 | 1092 | *msg = uwq->msg; |
---|
.. | .. |
---|
1259 | 1259 | * sure we've userfaults to wake. |
---|
1260 | 1260 | */ |
---|
1261 | 1261 | do { |
---|
1262 | | - seq = read_seqcount_begin(&ctx->refile_seq); |
---|
| 1262 | + seq = read_seqbegin(&ctx->refile_seq); |
---|
1263 | 1263 | need_wakeup = waitqueue_active(&ctx->fault_pending_wqh) || |
---|
1264 | 1264 | waitqueue_active(&ctx->fault_wqh); |
---|
1265 | 1265 | cond_resched(); |
---|
1266 | | - } while (read_seqcount_retry(&ctx->refile_seq, seq)); |
---|
| 1266 | + } while (read_seqretry(&ctx->refile_seq, seq)); |
---|
1267 | 1267 | if (need_wakeup) |
---|
1268 | 1268 | __wake_userfault(ctx, range); |
---|
1269 | 1269 | } |
---|
.. | .. |
---|
1941 | 1941 | init_waitqueue_head(&ctx->fault_wqh); |
---|
1942 | 1942 | init_waitqueue_head(&ctx->event_wqh); |
---|
1943 | 1943 | init_waitqueue_head(&ctx->fd_wqh); |
---|
1944 | | - seqcount_init(&ctx->refile_seq); |
---|
| 1944 | + seqlock_init(&ctx->refile_seq); |
---|
1945 | 1945 | } |
---|
1946 | 1946 | |
---|
1947 | 1947 | SYSCALL_DEFINE1(userfaultfd, int, flags) |
---|