Re: [PATCH 3/8] aio: add an interface to submit aio from the kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Zach Brown <zach.brown@xxxxxxxxxx> writes:

> This adds a simple interface that lets other parts of the kernel submit aio
> iocbs.  Callers provide a function which is called as the IO completes.
>
> These iocbs aren't tracked to reduce overhead: they can't be canceled, callers
> limit the number in flight, and previous patches in this series removed
> retry-based aio.
>
> Signed-off-by: Zach Brown <zach.brown@xxxxxxxxxx>

> +void aio_kernel_init_rw(struct kiocb *iocb, struct file *filp,
> +			unsigned short op, void *ptr, size_t nr, loff_t off)
> +{
> +	iocb->ki_filp = filp;
> +	iocb->ki_opcode = op;
> +	iocb->ki_buf = (char __user *)(unsigned long)ptr;
> +	iocb->ki_left = nr;
> +	iocb->ki_nbytes = nr;
> +	iocb->ki_pos = off;
> +}
> +EXPORT_SYMBOL_GPL(aio_kernel_init_rw);

Why isn't this just a static inline in a header, like the
io_prep_pread/pwrite methods in libaio.h?  Not a big deal, just curious.

> +int aio_kernel_submit(struct kiocb *iocb)

Why are you limiting this to just 1 iocb at a time?  Is it because the
overhead of a function call is pretty small (as compared to the
user/kernel context switch for the system call)?  I guess we can add a
mechanism to submit multiple iocbs if it becomes necessary.

Cheers,
Jeff
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux