Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Cephfs kernel client inode operation code for dir

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you cephfs kernel client for dir inode operation code, I hope you have something to gain after reading this article, let's discuss it together!

Cephfs kernel client's inode operation for dir

Const struct inode_operations ceph_dir_iops = {

.lookup = ceph_lookup

.clients = ceph_permission

.getattr = ceph_getattr

.setattr = ceph_setattr

.setxattr = generic_setxattr

.getxattr = generic_getxattr

.listxattr = ceph_listxattr

.removexattr = generic_removexattr

.get _ acl = ceph_get_acl

.set _ acl = ceph_set_acl

.mknod = ceph_mknod

.symlink = ceph_symlink

.mkdir = ceph_mkdir

.link = ceph_link

.unlink = ceph_unlink

.rmdir = ceph_unlink

.rename = ceph_rename

.create = ceph_create

.atomic _ open = ceph_atomic_open

}

This function is called when ceph_lookup (struct inode * dir, struct dentry * dentry, unsigned int flags) looks up a directory

| | _ _ call the ceph_init_dentry () function to initialize the dentry data structure, including the operation set ceph_dentry_ops for dentry |

| | _ _ sets the opcode op=CEPH_MDS_OP_LOOKUPSNAP or CEPH_MDS_OP_LOOKUP |

| | _ _ call the ceph_mdsc_create_request () function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

Ceph_permission (struct inode * inode, int mask) checks whether dir 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 |

Ceph_mknod (struct inode * dir, sturct dentry * dentry, umode_t mode, dev_t rdev)

| | _ _ call the ceph_pre_init_acls () function to get the mode and struct ceph_acls_info data structure content |

| | _ _ call ceph_mdsc_create_request (CEPH_MDS_OP_MKMOD) function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

Ceph_symlink (struct inode * dir, struct dentry * dentry, const char * dest)

| | _ _ call ceph_mdsc_create_request (CEPH_MDS_OP_SYMLINK) function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

Ceph_mkdir (struct inode * dir, struct dentry * dentry, umode_t mode)

| | _ _ get the opcode op=CEPH_MDS_OP_MKDIR or CEPH_MDS_OP_MKSNAP |

| | _ _ call ceph_mdsc_create_request (op) function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

| | _ _ call ceph_init_inode_acls () function to set the default acls of inode corresponding to dentry |

Ceph_link (struct dentry * old_dentry, struct inode * dir, struct dentry * dentry)

| | _ _ call ceph_mdsc_create_request (CEPH_MDS_OP_LINK) function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

Ceph_unlink (struct inode * dir, struct dentry * dentry)

| | _ _ get the opcode op=CEPH_MDS_OP_RMSNAP or CEPH_MDS_OP_RMDIR or CEPH_MDS_OP_RMLINK |

| | _ _ call ceph_mdsc_create_request (op) function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

Ceph_rename (struct inode * old_inode, struct dentry * old_dentry, struct inode * new_inode, struct dentry * new_dentry)

| | _ _ get the opcode op=CEPH_MDS_OP_RENAME or CEPH_MDS_OP_RENAMESNAP |

| | _ _ call ceph_mdsc_create_request (op) function to create a mds request |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

| | _ _ call ceph_dir_clear_complete () function to increase the reference count of release |

| | _ _ call d_move () function to update dentry in memory |

| | _ _ call the ceph_invalidate_dentry_lease () function to refresh the time and lease_shared_gen fields of dentry |

Ceph_create (struct inode * dir, struct dentry * dentry, umode_t mode, bool exel)

| | _ _ call the ceph_mknod () function to complete the creation of the directory |

Ceph_atomic_open (struct inode * dir, struct dentry * dentry, struct file * file, unsigned flags, umode_t mode, int * opened) lookup+open is implemented in a request

| | _ _ call the ceph_init_dentry () function to initialize the dentry data structure, including the operation set ceph_dentry_ops for dentry |

| | _ _ call the prepare_open_request () function to create a mds request whose opcode is CEPH_MDS_OP_CREATE or CEPH_MDS_OP_OPEN |

| | _ _ call the ceph_mdsc_do_request () function to send the request to the mds process synchronously |

After reading this article, I believe you have a certain understanding of "cephfs kernel client inode operation code for dir". 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report