Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\shmem.c Create Date:2022-07-28 14:20:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:mmon code

Proto:static struct file *__shmem_file_setup(struct vfsmount *mnt, const char *name, loff_t size, unsigned long flags, unsigned int i_flags)

Type:struct file

Parameter:

TypeParameterName
struct vfsmount *mnt
const char *name
loff_tsize
unsigned longflags
unsigned inti_flags
4099  If IS_ERR(mnt) Then Return ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
4102  If size < 0 || size > Page cache limit. The filesystems should put that into their s_maxbytes limits, otherwise bad things can happen in VM. Then Return ERR_PTR( - EINVAL)
4105  If shmem_acct_size(flags, size) Then Return ERR_PTR( - ENOMEM)
4108  inode = shmem_get_inode(mnt_sb, NULL, S_IFREG | S_IRWXUGO, 0, flags)
4110  If Value for the false possibility is greater at compile time(!inode) Then
4111  shmem_unacct_size(flags, size)
4112  Return ERR_PTR( - ENOSPC)
4114  i_flags |= i_flags
4115  i_size = size
4116  clear_nlink(inode)
4117  res = ERR_PTR(add a contiguous set of pages into a ramfs inode when it's truncated from* size 0 on the assumption that it's going to be used for an mmap of shared* memory)
4118  If Not IS_ERR(res) Then res = alloc_file_pseudo(inode, mnt, name, O_RDWR, & shmem_file_operations)
4121  If IS_ERR(res) Then put an inode
4123  Return res
Caller
NameDescribe
shmem_kernel_file_setupshmem_kernel_file_setup - get an unlinked file living in tmpfs which must be* kernel internal. There will be NO LSM permission checks against the* underlying inode. So users of this interface must do LSM checks at a* higher layer
shmem_file_setupshmem_file_setup - get an unlinked file living in tmpfs*@name: name for dentry (to be seen in /proc//maps*@size: size to be set for the file*@flags: VM_NORESERVE suppresses pre-accounting of the entire object size
shmem_file_setup_with_mntshmem_file_setup_with_mnt - get an unlinked file living in tmpfs*@mnt: the tmpfs mount where the file will be created*@name: name for dentry (to be seen in /proc//maps*@size: size to be set for the file*@flags: VM_NORESERVE suppresses pre-accounting