Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 14078
b: refs/heads/master
c: 20dcae3
h: refs/heads/master
v: v3
  • Loading branch information
Zach Brown authored and Linus Torvalds committed Nov 14, 2005
1 parent 79d35da commit f56a78d
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4557398f8cbaf9f254cff747534b4724c7f75c4f
refs/heads/master: 20dcae32439384b6863c626bb3b2a09bed65b33e
27 changes: 9 additions & 18 deletions trunk/fs/aio.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,28 +937,19 @@ int fastcall aio_complete(struct kiocb *iocb, long res, long res2)
unsigned long tail;
int ret;

/* Special case handling for sync iocbs: events go directly
* into the iocb for fast handling. Note that this will not
* work if we allow sync kiocbs to be cancelled. in which
* case the usage count checks will have to move under ctx_lock
* for all cases.
/*
* Special case handling for sync iocbs:
* - events go directly into the iocb for fast handling
* - the sync task with the iocb in its stack holds the single iocb
* ref, no other paths have a way to get another ref
* - the sync task helpfully left a reference to itself in the iocb
*/
if (is_sync_kiocb(iocb)) {
int ret;

BUG_ON(iocb->ki_users != 1);
iocb->ki_user_data = res;
if (iocb->ki_users == 1) {
iocb->ki_users = 0;
ret = 1;
} else {
spin_lock_irq(&ctx->ctx_lock);
iocb->ki_users--;
ret = (0 == iocb->ki_users);
spin_unlock_irq(&ctx->ctx_lock);
}
/* sync iocbs put the task here for us */
iocb->ki_users = 0;
wake_up_process(iocb->ki_obj.tsk);
return ret;
return 1;
}

info = &ctx->ring_info;
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/linux/aio.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ struct kiocb {
(x)->ki_users = 1; \
(x)->ki_key = KIOCB_SYNC_KEY; \
(x)->ki_filp = (filp); \
(x)->ki_ctx = &tsk->active_mm->default_kioctx; \
(x)->ki_ctx = NULL; \
(x)->ki_cancel = NULL; \
(x)->ki_dtor = NULL; \
(x)->ki_obj.tsk = tsk; \
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/init_task.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
.page_table_lock = SPIN_LOCK_UNLOCKED, \
.mmlist = LIST_HEAD_INIT(name.mmlist), \
.cpu_vm_mask = CPU_MASK_ALL, \
.default_kioctx = INIT_KIOCTX(name.default_kioctx, name), \
}

#define INIT_SIGNALS(sig) { \
Expand Down
1 change: 0 additions & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ struct mm_struct {
/* aio bits */
rwlock_t ioctx_list_lock;
struct kioctx *ioctx_list;
struct kioctx default_kioctx;
};

struct sighand_struct {
Expand Down
1 change: 0 additions & 1 deletion trunk/kernel/fork.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ static struct mm_struct * mm_init(struct mm_struct * mm)
spin_lock_init(&mm->page_table_lock);
rwlock_init(&mm->ioctx_list_lock);
mm->ioctx_list = NULL;
mm->default_kioctx = (struct kioctx)INIT_KIOCTX(mm->default_kioctx, *mm);
mm->free_area_cache = TASK_UNMAPPED_BASE;
mm->cached_hole_size = ~0UL;

Expand Down

0 comments on commit f56a78d

Please sign in to comment.