Cephfs kernel client operation code for dentry
This article mainly introduces the cephfs kernel client for dentry operation code, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
Operation of cephfs kernel client against dentry
Const struct dentry_operations ceph_dentry_ops = {
.d _ revalidate = ceph_d_revalidate
.d _ release = ceph_d_release
.d _ prune = ceph_d_prune
}
Ceph_d_revalidate (struct dentry * dentry, unsigned int flags) is used to check whether the dentry in cache is valid.
| | _ _ call the dget_parent () function to get the parent dentry corresponding to dentry |
| | _ _ call the d_inode () function to get the struct inode data corresponding to parent dentry |
| | _ _ call the dentry_lease_is_valid () function to check whether dentry lease is valid |
| | _ _ if invalid |
| | _ _ get 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 |
| | _ _ call ceph_dentry_lru_touch () function to add dentry to lru |
Ceph_d_release (struct dentry * dentry) is called when dentry is released
| | _ _ call ceph_dentry () function to get struct ceph_dentry_info data structure |
| | _ _ call ceph_dentry_lru_del () function to delete dentry from lru |
| | _ _ set dentry- > d_fsdata=NULL |
| | _ _ call ceph_put_mds_session () function to release lease session |
| | _ _ call the kmem_cache_free () function to release the struct ceph_dentry_info data structure from cache |
Ceph_d_prune (struct dentry * dentry) calls this function when vfs removes dentry from cache
| | _ _ call the IS_ROOT () function to check whether dentry contains a valid parent, and return it directly if dentry is root |
| | _ _ call the d_unhashed () function to check whether dentry is not hashed, and return it directly (no hashed dentry is affected) |
| | _ _ call the ceph_dir_clear_complete () function to reduce the reference count of i_release_count in the struct inode of dentry- > parent |
Thank you for reading this article carefully. I hope the article "cephfs kernel client Operation Code for dentry" shared by the editor will be helpful to everyone. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!