Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memfd.c Create Date:2022-07-28 16:37:59
Last Modify:2022-05-20 10:27:46 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:memfd_add_seals

Proto:static int memfd_add_seals(struct file *file, unsigned int seals)

Type:int

Parameter:

TypeParameterName
struct file *file
unsigned intseals
141  inode = file_inode(file)
176  If Not (f_mode & le is open for writing ) Then Return -EPERM
178  If seals & ~F_ALL_SEALS Then Return -EINVAL
181  inode_lock(inode)
183  file_seals = memfd_file_seals_ptr(file)
184  If Not file_seals Then
185  error = -EINVAL
186  Go to unlock
189  If file_seals & prevent further seals from being set Then
190  error = -EPERM
191  Go to unlock
194  If seals & prevent writes && Not (file_seals & prevent writes ) Then
195  error = mapping_deny_writable(f_mapping)
196  If error Then Go to unlock
199  error = Setting SEAL_WRITE requires us to verify there's no pending writer. However,* via get_user_pages(), drivers might have some pending I/O without any active* user-space mappings (eg., direct-IO, AIO). Therefore, we look at all pages
200  If error Then
202  Go to unlock
206  file_seals |= seals
207  error = 0
209  unlock :
210  inode_unlock(inode)
211  Return error
Caller
NameDescribe
memfd_fcntl