Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319986
b: refs/heads/master
c: f7e1bec
h: refs/heads/master
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Jul 31, 2012
1 parent a1da2fb commit 46e20c1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 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: 98c350cda2c14a343d34ea01a3d9c24fea5ec66d
refs/heads/master: f7e1becb078c2b996420a61f2a411ef19335e2da
38 changes: 20 additions & 18 deletions trunk/include/linux/aio.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,22 +126,20 @@ struct kiocb {
struct eventfd_ctx *ki_eventfd;
};

#define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY)
#define init_sync_kiocb(x, filp) \
do { \
struct task_struct *tsk = current; \
(x)->ki_flags = 0; \
(x)->ki_users = 1; \
(x)->ki_key = KIOCB_SYNC_KEY; \
(x)->ki_filp = (filp); \
(x)->ki_ctx = NULL; \
(x)->ki_cancel = NULL; \
(x)->ki_retry = NULL; \
(x)->ki_dtor = NULL; \
(x)->ki_obj.tsk = tsk; \
(x)->ki_user_data = 0; \
(x)->private = NULL; \
} while (0)
static inline bool is_sync_kiocb(struct kiocb *kiocb)
{
return kiocb->ki_key == KIOCB_SYNC_KEY;
}

static inline void init_sync_kiocb(struct kiocb *kiocb, struct file *filp)
{
*kiocb = (struct kiocb) {
.ki_users = 1,
.ki_key = KIOCB_SYNC_KEY,
.ki_filp = filp,
.ki_obj.tsk = current,
};
}

#define AIO_RING_MAGIC 0xa10a10a1
#define AIO_RING_COMPAT_FEATURES 1
Expand All @@ -161,8 +159,6 @@ struct aio_ring {
struct io_event io_events[0];
}; /* 128 bytes + ring size */

#define aio_ring_avail(info, ring) (((ring)->head + (info)->nr - 1 - (ring)->tail) % (info)->nr)

#define AIO_RING_PAGES 8
struct aio_ring_info {
unsigned long mmap_base;
Expand All @@ -177,6 +173,12 @@ struct aio_ring_info {
struct page *internal_pages[AIO_RING_PAGES];
};

static inline unsigned aio_ring_avail(struct aio_ring_info *info,
struct aio_ring *ring)
{
return (ring->head + info->nr - 1 - ring->tail) % info->nr;
}

struct kioctx {
atomic_t users;
int dead;
Expand Down

0 comments on commit 46e20c1

Please sign in to comment.