函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:/register

函数原型:static ssize_t bm_register_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)

返回类型:ssize_t

参数:

类型参数名称
struct file *file
const char __user *buffer
size_tcount
loff_t *ppos
696  sb等于i_sb
697  root等于s_root
698  err等于0
700  e等于This registers a new binary format, it recognises the syntax* ':name:type:offset:magic:mask:interpreter:flags'* where the ':' is the IFS, that can be chosen with the first char
702  如果是错误则返回:错误
705  inode_lock(获得目录项的索引节点)
706  dentry等于lookup_one_len - filesystem helper to lookup single pathname component*@name: pathname component to lookup*@base: base directory to lookup from*@len: maximum length @len should be interpreted to* Note that this routine is purely a helper for filesystem
707  err等于错误
708  如果是错误则转到:out
711  err等于负EEXIST
712  如果d_really_is_positive - Determine if a dentry is really positive (ignoring fallthroughs)*@dentry: The dentry in question* Returns true if the dentry represents a name that maps to an inode* (ie则转到:out2
715  inode等于bm_get_inode(sb, S_IFREG | 0644)
717  err等于负ENOMEM
718  如果非inode则转到:out2
721  err等于simple_pin_fs( & bm_fs_type, & bm_mnt, & entry_count)
722  如果err
723  放置一个索引节点
724  inode = NULL
725  转到:out2
728  如果 type, status, etc. 按位与MISC_FMT_OPEN_FILE
731  f等于open_exec( filename of interpreter )
732  如果是错误
733  err等于错误
734  打印注释信息("register: failed to install interpreter file %s\n", filename of interpreter )
737  inode = NULL
738  转到:out2
740  interp_file等于f
743  dentry等于获得目录项引用
744  s or device private pointer 等于e
745  rmer ->i_op->default_file_ops 等于bm_entry_operations
747  为目录项建立索引
748  write_lock( & entries_lock)
749  添加链表项
750  write_unlock( & entries_lock)
752  err等于0
753  out2 :
754  dput - release a dentry*@dentry: dentry to release * Release a dentry. This will drop the usage count and if appropriate* call the dentry unlink method as well as removing it from the queues and* releasing its resources
755  out :
756  inode_unlock(获得目录项的索引节点)
758  如果err
759  释放内存
760  返回:err
762  返回:count