函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\pipe.c Create Date:2022-07-29 10:34:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:alloc_pipe_info

函数原型:struct pipe_inode_info *alloc_pipe_info(void)

返回类型:struct pipe_inode_info

参数:

766  pipe_bufs等于PIPE_DEF_BUFFERS
767  user等于get_current_user - Get the current task's user_struct* Get the user record of the current task, pinning it so that it can't go* away.()
769  max_size等于READ_ONCE(The max size that a non-root user is allowed to grow the pipe. Can* be set by root in /proc/sys/fs/pipe-max-size)
771  pipe等于分配内存并置零
772  如果(pipe == NULL)则转到:out_free_uid
775  如果pipe_bufsPAGE_SIZE大于max_size且非操作权限检查pipe_bufs等于max_size右移PAGE_SHIFT determines the page size
778  user_bufs等于account_pipe_buffers(user, 0, pipe_bufs)
780  如果too_many_pipe_buffers_soft(user_bufs)且is_unprivileged_user()则
781  user_bufs等于account_pipe_buffers(user, pipe_bufs, 1)
782  pipe_bufs等于1
785  如果too_many_pipe_buffers_hard(user_bufs)且is_unprivileged_user()则转到:out_revert_acct
788  bufs等于分配数组内存并置零
791  如果bufs
792  init_waitqueue_head( & wait)
793  r_counter等于w_counter等于1
794  max_usage等于pipe_bufs
795  ring_size等于pipe_bufs
796  user等于user
797  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.( & mutex)
798  返回:pipe
801  out_revert_acct :
802  account_pipe_buffers(user, pipe_bufs, 0)
803  释放内存
804  out_free_uid :
805  free_uid(user)
806  返回:NULL
调用者
名称描述
get_pipe_inode
fifo_open
splice_direct_to_actorsplice_direct_to_actor - splices data directly between two non-pipes*@in: file to splice from*@sd: actor information on where to splice to*@actor: handles the data splicing* Description:* This is a special case helper to splice directly between two