inode_operations

cephfs kernel client针对inode的相关操作

随声附和 提交于 2019-12-09 10:11:14
针对文件的inode的操作体现在数据结构struct inode_operations中,具体内容如下: const struct inode_operations ceph_file_iops = { .permission = ceph_permission, .setattr = ceph_setattr, .getattr = ceph_getattr, .setxattr = generic_setxattr, .getxattr = generic_getxattr, .listxattr = ceph_listxattr, .removexattr = generic_removexattr, .get_acl = ceph_get_acl, .set_acl = ceph_set_acl, }; ceph_permission(struct inode *inode, int mask) 检查inode是否有mask指定的访问权限 |__调用ceph_do_getattr()函数从本地缓存或mds集群中得到CEPH_CAP_AUTH_SHARED对应的权限 |__调用generic_permission()函数做常规的权限检查 ceph_setattr(struct dentry *dentry, struct iattr *attr) 设置文件属性时调用该函数 |

cephfs kernel client针对dir的inode操作

删除回忆录丶 提交于 2019-12-07 14:02:24
cephfs kernel client针对dir的inode操作 const struct inode_operations ceph_dir_iops = { .lookup = ceph_lookup, .permission = 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, }; ceph_lookup(struct inode