函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\memfd.c Create Date:2022-07-27 18:13:20
Last Modify:2022-05-20 10:27:46 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:memfd_add_seals

函数原型:static int memfd_add_seals(struct file *file, unsigned int seals)

返回类型:int

参数:

类型参数名称
struct file *file
unsigned intseals
141  inode等于file_inode(file)
176  如果非f_mode按位与le is open for writing 的值则返回:负EPERM
178  如果seals按位与F_ALL_SEALS的反则返回:负EINVAL
181  inode_lock(inode)
183  file_seals等于memfd_file_seals_ptr(file)
184  如果非file_seals
185  error等于负EINVAL
186  转到:unlock
189  如果file_seals按位与prevent further seals from being set
190  error等于负EPERM
191  转到:unlock
194  如果seals按位与prevent writes 且非file_seals按位与prevent writes 的值则
195  error等于mapping_deny_writable(f_mapping)
196  如果error则转到: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  如果error
202  转到:unlock
206  file_seals或等于seals
207  error等于0
209  unlock :
210  inode_unlock(inode)
211  返回:error
调用者
名称描述
memfd_fcntl