cephfs linux kernel client针对ceph_inode_info相关工作队列处理函数分析

struct ceph_inode_info {

    ......

    struct work_struct i_wb_work;                //writeback work

    struct work_struct i_pg_inv_work;        //page invaliate work

    struct work_struct i_vmtruncate_work;

    ......

};

struct ceph_inode_info->i_wb_work工作队列处理函数

ceph_writeback_work(struct work_struct *work)

|__从work得到struct ceph_inode_info结构

|__从struct ceph_inode_info结构得到struct inode结构

|__调用filemap_fdatawrite(&inode->i_data)函数将inode->i_data指定的struct address_space中的dirty数据回写到ceph集群中

    |__调用__filemap_fdatawrite()函数

        |__调用__filemap_fdatawrite_range()函数

            |__创建struct writeback_control结构且初始化

            |__调用wbc_attach_fdatawrite_inode()函数将struct writeback_control结构添加到struct inode中

            |__调用do_writepages()函数将struct address_space中的dirty数据回写到ceph集群

                |__调用ceph_writepages_start()函数进行数据回写操作

 

struct ceph_inode_info->i_pg_inv_work工作队列处理函数

ceph_invalidate_work(struct work_struct *work)

|__从work得到struct ceph_inode_info结构

|__从struct ceph_inode_info结构得到struct inode结构

|__从struct inode结构得到struct ceph_fs_client结构

|__调用invalidate_inode_page2()函数清除掉inode->i_mapping指定的struct address_space中的所有pages

 

struct ceph_inode_info->i_vmtruncate_work工作队列处理函数

ceph_vmtruncate_work(struct work_strcut *work)

|__从work得到struct ceph_inode_info结构

|__从struct ceph_inode_info结构得到struct inode结构

|__调用__ceph_do_pending_vmtruncate()函数truncate struct inode结构中的struct address_space对应的所有pages

    |__调用truncate_pagecache()函数解除映射并且删除已经truncated的pagecache

    |__调用wake_up_all(&ci->i_cap_wq)函数唤醒struct ceph_inode_info->i_cap_wq上的等待进程

 

转载于:https://my.oschina.net/linuxhunter/blog/732863

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值