cephfs kernel client针对dentry的操做

cephfs kernel client针对dentry的操做node

const struct dentry_operations ceph_dentry_ops = {session

        .d_revalidate = ceph_d_revalidate,数据结构

        .d_release = ceph_d_release,函数

        .d_prune = ceph_d_prune,进程

};get

 

ceph_d_revalidate(struct dentry *dentry, unsigned int flags)    用于检查cache中的dentry是否有效同步

|__调用dget_parent()函数获得dentry对应的parent dentryhash

|__调用d_inode()函数获得parent dentry对应的struct inode数据io

|__调用dentry_lease_is_valid()函数检查dentry lease是否有效cli

|__若无效

    |__获得操做码op=CEPH_MDS_OP_LOOKUPSNAP或者CEPH_MDS_OP_LOOKUP

    |__调用ceph_mdsc_create_request()函数建立mds请求

    |__调用ceph_mdsc_do_request()函数将请求同步发送给mds进程

    |__调用ceph_dentry_lru_touch()函数将dentry添加到lru中

 

ceph_d_release(struct dentry *dentry)        释放dentry时被调用

|__调用ceph_dentry()函数获得struct ceph_dentry_info数据结构

|__调用ceph_dentry_lru_del()函数将dentry从lru中删除

|__设置dentry->d_fsdata=NULL

|__调用ceph_put_mds_session()函数释放lease session

|__调用kmem_cache_free()函数从cache中释放struct ceph_dentry_info数据结构

 

ceph_d_prune(struct dentry *dentry)        当vfs从cache中删除dentry时调用该函数

|__调用IS_ROOT()函数检查dentry是否包含有效的parent,若dentry是root则直接返回

|__调用d_unhashed()函数检查dentry是否不是hashed,如果则直接返回(未hashed dentry不受影响)

|__调用ceph_dir_clear_complete()函数减小dentry->parent的struct inode中的中的i_release_count的引用计数值

相关文章
相关标签/搜索