Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:/register

Proto:static ssize_t bm_register_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)

Type:ssize_t

Parameter:

TypeParameterName
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  If IS_ERR(e) Then Return PTR_ERR(e)
705  inode_lock(d_inode - Get the actual inode of this dentry*@dentry: The dentry to query* This is the helper normal filesystems should use to get at their own inodes* in their own dentries and ignore the layering superimposed upon them.)
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 = PTR_ERR(dentry)
708  If IS_ERR(dentry) Then Go to out
711  err = -EEXIST
712  If 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 Then Go to out2
715  inode = bm_get_inode(sb, S_IFREG | 0644)
717  err = -ENOMEM
718  If Not inode Then Go to out2
721  err = simple_pin_fs( & bm_fs_type, & bm_mnt, & entry_count)
722  If err Then
723  put an inode
724  inode = NULL
725  Go to out2
728  If type, status, etc. & MISC_FMT_OPEN_FILE Then
731  f = open_exec( filename of interpreter )
732  If IS_ERR(f) Then
733  err = PTR_ERR(f)
734  pr_notice("register: failed to install interpreter file %s\n", filename of interpreter )
736  put an inode
737  inode = NULL
738  Go to out2
740  interp_file = f
743  dentry = get a reference to a dentry
744  s or device private pointer = e
745  rmer ->i_op->default_file_ops = bm_entry_operations
747  d_instantiate - fill in inode information for a dentry*@entry: dentry to complete*@inode: inode to attach to this dentry* Fill in inode information in the entry
748  write_lock( & entries_lock)
749  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.
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(d_inode - Get the actual inode of this dentry*@dentry: The dentry to query* This is the helper normal filesystems should use to get at their own inodes* in their own dentries and ignore the layering superimposed upon them.)
758  If err Then
759  kfree(e)
760  Return err
762  Return count