Kernel File System API d_alloc, kernel apid_alloc

Source: Internet
Author: User

Kernel File System API d_alloc, kernel apid_alloc

D_alloc for Kernel File System APIs

Struct dentry * d_alloc (struct dentry * parent, const struct qstr * name) is used to apply for and return a dentry. The source code analysis is as follows: struct dentry * d_alloc (struct dentry * parent, const struct qstr * name) {# these first applications apply for a dentry struct dentry * dentry = _ d_alloc (parent-> d_sb, name ); # If the requested struct is null, nullif (! Dentry) return NULL; # flag value: dentry-> d_flags | = DCACHE_RCUACCESS; spin_lock (& parent-> d_lock ); /** don't need child lock because it is not subject * to concurrency here */_ dget_dlock (parent); # d_parent value dentry-> d_parent = parent; # Add this dentry to the list of parent dentry list_add (& dentry-> d_child, & parent-> d_subdirs); spin_unlock (& parent-> d_lock ); # Return the dentryreturn dentry that has been assigned a value ;}

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.