In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
Editor to share with you the relevant operation code of cephfs kernel client for inode. I hope you will get something after reading this article. Let's discuss it together.
The operation of the inode for the file is reflected in the data structure struct inode_operations, as shown below:
Const struct inode_operations ceph_file_iops = {
.clients = ceph_permission
.setattr = ceph_setattr
.getattr = ceph_getattr
.setxattr = generic_setxattr
.getxattr = generic_getxattr
.listxattr = ceph_listxattr
.removexattr = generic_removexattr
.get _ acl = ceph_get_acl
.set _ acl = ceph_set_acl
}
Ceph_permission (struct inode * inode, int mask) checks whether inode has the access rights specified by mask
| | _ _ call the ceph_do_getattr () function to get the permissions corresponding to CEPH_CAP_AUTH_SHARED from the local cache or mds cluster |
| | _ _ call the generic_permission () function for general permission checking |
This function is called when ceph_setattr (struct dentry * dentry, struct iattr * attr) sets file properties.
| | _ _ call _ _ ceph_setattr () function |
| | _ _ call ceph_mdsc_create_request () function to create mds cluster request |
| | _ _ specific items in the request data structure based on the content of setting specific attributes, such as ATTR_UID/ATTR_GID/ATTR_MODE/ATTR_ATIME/ATTR_MTIME/ATTR_SIZE/ATTR_CTIME |
| | _ _ call the ceph_mdsc_do_reqeust () function to send the request to the mds process synchronously |
This function is called when ceph_getattr (struct vfsmount * mnt, struct dentry * dentry, struct kstat * stat) gets file attributes.
| | _ _ call the ceph_do_getattr (CEPH_STAT_CAP_INODE_ALL) function to read all attribute values of inode from the mds cluster |
| | _ _ call the generic_fillattr () function to set common attribute values to stat |
| | _ _ set cephfs-related attribute values to stat |
This function is called when ceph_listxattr (struct dentry * dentry, char * names, size_t size) lists the xattrs of inode
| | _ _ if version of xattrs is 0 |
| | _ _ call ceph_do_getattr (CEPH_STAT_CAP_XATTR) function to read xattr information from mds cluster |
| | _ _ call _ _ build_xattrs () function to create xattr attribute |
| | _ _ call _ _ copy_xattr_names () function to copy all the name information of xattr attribute to the names array |
Ceph_get_acl (struct inode * inode, int type) calls this function when reading the acl information of inode.
| | _ _ call _ _ ceph_getxattr () function to read the attribute values of XATTR_NAME_POSIX_ACL_ACCESS or XATTR_NAME_POSIX_ACL_DEFUALT from the mds cluster |
| | _ _ call the posix_acl_from_xattr () function to read acl information into the struct posix_acl data structure in memory |
| | _ _ call the ceph_set_cache_acl () function to write the struct posix_acl data structure in memory to cache |
This function is called when ceph_set_acl (struct inode * inode, struct posix_acl * acl, int type) sets the acl information of inode.
| | _ _ call posix_acl_xattr_size () function to get the size of xattr |
| | _ _ call posix_acl_to_xattr () function to convert acl to xattr format |
| | _ _ call _ _ ceph_setxattr () function to write xattr data converted by acl to mds cluster |
| | _ _ call ceph_set_cached_acl () function to write new acl information to cache |
After reading this article, I believe you have a certain understanding of "cephfs kernel client related operation codes for inode". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.