在线精品99_中国九九盗摄偷拍偷看_91免费版在线观看_91.app_91高清视频在线_99热最新网站

cephfs linux kernel client针对fscache的操作代码

114次阅读
没有评论

共计 4344 个字符,预计需要花费 11 分钟才能阅读完成。

这篇文章主要为大家展示了“cephfs linux kernel client 针对 fscache 的操作代码”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让丸趣 TV 小编带领大家一起研究并学习一下“cephfs linux kernel client 针对 fscache 的操作代码”这篇文章吧。

针对 inode 在 fscache 中操作主要集中在数据结构 struct fscache_cookie_def 中,具体的数据结构及其操作如下:

static const struct fscache_cookie_def ceph_fscache_inode_object_def = {

        .name           = CEPH.inode ,

        .type           = FSCACHE_COOKIE_TYPE_DATAFILE,

        .get_key        = ceph_fscache_inode_get_key,

        .get_attr       = ceph_fscache_inode_get_attr,

        .get_aux        = ceph_fscache_inode_get_aux,

        .check_aux      = ceph_fscache_inode_check_aux,

        .now_uncached   = ceph_fscache_inode_now_uncached,

};

ceph_fscache_inode_get_key(void *cookie_netfs_data, void *buffer, uint16_t maxbuf)    读取 struct ceph_inode_info 中的 i_vino 信息到 buffer

|__从参数 cookie_netfs_data 的到 struct ceph_inode_info 数据结构

|__调用 memcpy() 将 struct ceph_inode_info 中的 i_vino 内容复制到 buffer 中

ceph_fscache_inode_get_attr(void *cookie_netfs_data, uint64_t *size)    读取 struct ceph_inode_info 中 vfs_inode 的大小

|__从参数 cookie_netfs_data 的到 struct ceph_inode_info 数据结构

|__调用 i_size_read() 函数读取 struct ceph_inode_info 中 vfs_inode 的大小且保存到 size 中

ceph_fscache_inode_get_aux(void *cookie_netfs_data, void *buffer, uint16_t bufmax)

|__从参数 cookie_netfs_data 的到 struct ceph_inode_info 数据结构

|__初始化 struct ceph_aux_inode 信息

|__从 struct ceph_inode_info 结构中初始化 struct ceph_aux_inode 信息

|__将 struct ceph_aux_inode 信息复制到 buffer 中

ceph_fscache_inode_check_aux(void *cookie_netfs_data, void *data, uint16_t dlen)

|__从参数 cookie_netfs_data 的到 struct ceph_inode_info 数据结构

|__从 struct ceph_inode_info 结构中初始化 struct ceph_aux_inode 信息

|__比较参数中的 data 和初始化后的 struct ceph_aux_inode 信息

ceph_fscache_inode_now_uncached(void *cookie_netfs_data)

|__从参数 cookie_netfs_data 的到 struct ceph_inode_info 数据结构

|__调用 pagevec_init() 函数初始化 pvec

|__调用 pagevec_lookup() 函数查找 struct ceph_inode_info 里 vfs_inode.i_mapping 里所有映射的物理内存页

|__调用 ClearPageFsCache() 函数清除物理内存页的 fscache

|__调用 pagevec_release() 函数释放 pvec

ceph_fscache_register_inode_cookie(struct inode *inode)

|__从参数 inode 中得到 struct ceph_inode_info 以及 struct ceph_fs_client 信息

|__调用 fscache_acquire_cookie() 函数得到访问 ceph fscache 的 cookie 值且将该 cookie 值保存到 struct ceph_inode_info 的 fscache 中

ceph_fscache_unregister_inode_cookie(struct ceph_inode_info *ci)

|__调用 fscache_uncache_all_inode_pages() 函数从 cache 中删除所有 inode 占用的物理内存页

|__调用 fscache_relinquish_cookie() 函数删除 cookie

ceph_fscache_can_enable(void *data)

|__从参数 data 中得到 struct inode 数据结构

|__调用 inode_is_open_for_write(inode) 函数且返回该函数返回值的非

ceph_fscache_file_set_cookie(struct inode *inode, struct file *filp)

|__从参数 inode 得到 struct ceph_inode_info 数据结构

|__调用 fscache_cookie_valid() 函数检查 struct ceph_inode_info 中的 fscache 是否有效,若无效则直接返回

|__调用 inode_is_open_for_write() 函数检查 inode 是打开并可写

   |__调用 fscache_disable_cookie() 函数禁用 cookie

   |__调用 fscache_uncache_all_inode_pages() 函数删除掉 cache 中 inode 的所有物理内存页

|__调用 inode_is_open_for_write() 函数检查 inode 是未打开且不可写

   |__调用 fscache_enable_cookie() 函数启用 cookie

ceph_fscache_register()

|__调用 fscache_register_netfs() 函数注册 ceph 的 fscache

ceph_fscache_unregister()

|__调用 fscache_unregister_netfs() 函数注销 ceph 的 fscache

ceph_fscache_register_fs(struct ceph_fs_client *fs)

|__调用 fscache_acquire_cookie() 函数得到访问 ceph fscache 的 cookie 值且将该 cookie 值保存到 struct ceph_fs_client 的 fscache 中

ceph_fscache_unregister_fs(struct ceph_fs_client *fsc)

|__调用 fscache_relinquish_cookie() 函数释放 fsc- fscache 数据结构

ceph_fscache_session_get_key(void *cookie_netfs_data, void *buffer, uint16_t maxbuf)

|__从参数 cookie_netfs_data 的到 struct ceph_fs_client 数据结构

|__调用 memcpy() 函数将 struct ceph_fs_client 数据结构中的 client- fsid 值复制到 buffer 中

ceph_readpage_from_fscache(struct inode *inode, struct page *page)

|__从参数 inode 得到 struct ceph_inode_info 数据结构

|__调用 fscache_read_or_alloc_page() 函数从 fscache 中读取 inode 的内容并写到 page 中

ceph_readpages_from_fscache(struct inode *inode, struct address_space *mapping, struct list_head *pages, unsigned *nr_pages)

|__从参数 inode 得到 struct ceph_inode_info 数据结构

|__调用 fscache_read_or_alloc_pages() 函数从 fscahe 中读取 mapping 中的数据并写入到 pages 中

ceph_readpage_to_fscache(struct inode *inode, struct page *page)

|__从参数 inode 得到 struct ceph_inode_info 数据结构

|__调用 fscache_write_page() 函数将物理内存页 page 中的数据同步到 fscache 中

ceph_invalidate_fscache_page(struct inode *inode, struct page *page)

|__从参数 inode 得到 struct ceph_inode_info 数据结构

|__调用 fscache_wait_on_page_write() 函数等待 page 写入完成

|__调用 fscache_uncache_page() 函数将 page 中的内容从 struct ceph_inode_info 中的 fscache 中删除

ceph_fscache_revalidate_cookie(struct ceph_inode_info *ci)

|__调用 cache_valid() 函数检查 ci 指定的 fscache 是否有效,若无效

   |__调用 fscache_check_consistency() 函数校验 ci- fscache 的一致性,若不一致

     |__调用 fscache_invalidate() 函数设置 ci- fscache 无效

   |__设置 ci- i_fscache_gen=ci- i_rdcache_gen

以上是“cephfs linux kernel client 针对 fscache 的操作代码”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注丸趣 TV 行业资讯频道!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-08-16发表,共计4344字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)
主站蜘蛛池模板: 国产亚洲欧美日韩在线观看不卡 | 欧美另类视频在线 | 国产午夜精品一区二区三区小说 | 在线 亚洲 欧美 | 日本免费一区二区三区 | 久久一本 | 国产二区交换配乱婬 | 玩弄人妻少妇500系列视频 | 久久99精品久久久久久hb无码 | 女人被狂躁到高潮视频免费网站 | 娜娜麻豆国产电影 | 国产精品久久天天影视 | 欧美太黄太色视频在线观看 | 丝袜美腿精品一区二区三 | 亚洲男女网站 | 亚洲av无码专区国产乱码电影 | 高清色本在线www | 久久这里只有精品免费视频 | 尤物在线精品视频 | 欧美一级特黄aa大片婷婷 | 综合自拍亚洲综合图不卡区 | 成人午夜18免费看 | 久久国产乱子伦精品免费一 | 一本大道无码日韩精品影视_ | 精品欧美亚洲韩国日本久久 | 婷婷综合网 | 99热久久这里只有精品首页 | 国产影片中文字幕 | 国产md视频一区二区三区 | 国产乡下三级全黄三级bd | 亚洲一区免费观看 | 国产亚洲女在线线精品 | 女女互揉吃奶揉到高潮视频 | 自偷自偷自亚洲首页精品 | 亚洲精品无码永久电影在线 | 成人不卡| 久久午夜无码鲁丝片午夜精品 | 一区免费视频 | 亚洲av成人一区二区三区观看 | 久久精品国产亚洲av电影网 | 黄色成人免费网站 |