Function report |
Source Code:fs\aio.c |
Create Date:2022-07-28 20:21:14 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:x_alloc* Allocates and initializes an ioctx. Returns an ERR_PTR if it failed.
Proto:static struct kioctx *ioctx_alloc(unsigned nr_events)
Type:struct kioctx
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned | nr_events |
722 | nr_events = max - return maximum of two values of the same or compatible types*@x: first value*@y: second value(nr_events, num_possible_cpus() * 4) |
723 | nr_events *= 2 |
731 | If Not nr_events || max_reqs > system wide maximum number of aio requests Then Return ERR_PTR( - EAGAIN) |
742 | mutex_init - initialize the mutex*@mutex: the mutex to be initialized* Initialize the mutex to unlocked state.* It is not allowed to initialize an already locked mutex.( & ring_lock) |
745 | mutex_lock( & ring_lock) |
746 | init_waitqueue_head( & wait) |
756 | cpu = alloc_percpu(structkioctx_cpu) |
760 | err = aio_setup_ring(ctx, nr_events) |
765 | * For percpu reqs_available, number of slots we move to/from global * counter at a time: = ( Size of ringbuffer, in units of struct io_event - 1) / num_possible_cpus() * 4 |
766 | If * For percpu reqs_available, number of slots we move to/from global * counter at a time: < 1 Then * For percpu reqs_available, number of slots we move to/from global * counter at a time: = 1 |
770 | spin_lock( & ------ sysctl variables----) |
783 | err = ioctx_add_table(ctx, mm) |
784 | If err Then Go to err_cleanup |
790 | pr_debug("allocated ioctx %p[%ld]: mm=%p mask=0x%x\n", ctx, user_id, mm, Size of ringbuffer, in units of struct io_event ) |
792 | Return ctx |
794 | err_cleanup : |
796 | err_ctx : |
797 | atomic_set( & dead, 1) |
800 | aio_free_ring(ctx) |
801 | err : |
806 | kmem_cache_free(kioctx_cachep, ctx) |
Name | Describe |
---|---|
SYSCALL_DEFINE2 | sys_io_setup:* Create an aio_context capable of receiving at least nr_events |
COMPAT_SYSCALL_DEFINE2 |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |