24 #ifndef __MOTR_M0T1FS_M0T1FS_H__ 25 #define __MOTR_M0T1FS_M0T1FS_H__ 28 #include <linux/version.h> 29 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) 30 #include <linux/backing-dev.h> 32 #include <linux/pagemap.h> 644 M0T1FS_RPC_TIMEOUT = 100,
645 M0T1FS_RPC_MAX_RETRIES = 10,
646 M0T1FS_RPC_RESEND_INTERVAL =
M0_MKTIME(M0T1FS_RPC_TIMEOUT, 0) /
647 M0T1FS_RPC_MAX_RETRIES,
648 M0T1FS_MAX_NR_RPC_IN_FLIGHT = 100,
649 M0T1FS_DEFAULT_NR_DATA_UNITS = 1,
650 M0T1FS_DEFAULT_NR_PARITY_UNITS = 1,
651 M0T1FS_DEFAULT_STRIPE_UNIT_SIZE =
PAGE_SIZE,
652 M0T1FS_MAX_NR_CONTAINERS = 4096,
653 M0T1FS_COB_ID_STRLEN = 34,
671 uint32_t csb_nr_containers;
674 uint64_t csb_next_key;
705 struct m0_fid csb_root_fid;
725 struct dentry *csb_motr_dentry;
728 struct dentry *csb_fid_dentry;
746 struct m0_tl csb_inodes;
753 struct m0_htable csb_service_pending_txid_map;
754 struct m0_mutex csb_service_pending_txid_map_lock;
770 struct m0_clink csb_conf_ready_async;
776 struct m0_chan csb_conf_ready_chan;
782 uint64_t csb_reqs_nr;
784 struct m0_fid csb_process_fid;
785 struct m0_fid csb_profile_fid;
789 #if LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) 790 struct backing_dev_info csb_backing_dev_info;
794 struct m0t1fs_filedata {
797 uint32_t fd_mds_index;
808 uint32_t mo_hash_hint;
817 struct m0t1fs_inode {
819 struct inode ci_inode;
839 struct m0_tl ci_pending_tx;
846 bool ci_layout_changed;
855 static inline struct m0t1fs_sb *M0T1FS_SB(
const struct super_block *
sb)
857 return sb->s_fs_info;
860 static inline struct m0t1fs_inode *M0T1FS_I(
const struct inode *
inode)
873 extern const struct address_space_operations
m0t1fs_aops;
877 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 879 int flags,
const char *devname,
882 M0_INTERNAL
int m0t1fs_get_sb(
struct file_system_type *fstype,
885 void *
data,
struct vfsmount *mnt);
900 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) 901 M0_INTERNAL
int m0t1fs_getattr(
const struct path *path,
struct kstat *
stat,
902 uint32_t request_mask, uint32_t query_flags);
904 uint32_t request_mask, uint32_t query_flags);
906 M0_INTERNAL
int m0t1fs_getattr(
struct vfsmount *mnt,
struct dentry *de,
912 M0_INTERNAL
int m0t1fs_fid_setattr(
struct dentry *
dentry,
struct iattr *
attr);
928 uint64_t container_id);
947 const struct m0_fid *root_fid);
965 struct m0t1fs_sb *
csb);
974 struct io_mem_stats {
977 uint64_t a_pargrp_iomap_nr;
978 uint64_t d_pargrp_iomap_nr;
979 uint64_t a_target_ioreq_nr;
980 uint64_t d_target_ioreq_nr;
981 uint64_t a_io_req_fop_nr;
982 uint64_t d_io_req_fop_nr;
983 uint64_t a_data_buf_nr;
984 uint64_t d_data_buf_nr;
990 const struct m0t1fs_mdop *
mo,
994 const struct m0t1fs_mdop *
mo,
998 const struct m0t1fs_mdop *
mo,
1002 const struct m0t1fs_mdop *
mo,
1006 const struct m0t1fs_mdop *
mo,
1013 const struct m0t1fs_mdop *
mo,
1017 const struct m0t1fs_mdop *
mo,
1021 const struct m0t1fs_mdop *
mo,
1025 const struct m0t1fs_mdop *
mo,
1029 const struct m0t1fs_mdop *
mo,
1033 const struct m0t1fs_mdop *
mo,
1040 struct m0t1fs_mdop *
mo,
1042 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1081 M0_INTERNAL
const struct m0_fid *
1092 unsigned long fid_hash(
const struct m0_fid *
fid);
ssize_t m0t1fs_listxattr(struct dentry *dentry, char *buffer, size_t size)
M0_INTERNAL struct inode * m0t1fs_iget(struct super_block *sb, const struct m0_fid *fid, struct m0_fop_cob *body)
M0_INTERNAL struct m0t1fs_sb * m0_fop_to_sb(struct m0_fop *fop)
M0_INTERNAL int m0t1fs_inode_layout_init(struct m0t1fs_inode *ci)
int m0t1fs_removexattr(struct dentry *dentry, const char *name)
int m0t1fs_mds_cob_lookup(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
int const char const void size_t int flags
M0_INTERNAL int struct dentry struct kstat * stat
M0_INTERNAL int m0t1fs_inode_cache_init(void)
M0_INTERNAL int m0t1fs_fill_cob_attr(struct m0_fop_cob *body)
M0_INTERNAL const struct m0_fid * m0t1fs_inode_fid(const struct m0t1fs_inode *ci)
M0_INTERNAL void m0t1fs_destroy_inode(struct inode *inode)
int m0t1fs_mds_cob_getattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
const struct address_space_operations m0t1fs_aops
M0_INTERNAL struct m0_rconfc * m0_csb2rconfc(struct m0t1fs_sb *csb)
M0_INTERNAL struct m0_rpc_session * m0t1fs_filename_to_mds_session(const struct m0t1fs_sb *csb, const unsigned char *filename, unsigned int nlen, bool use_hint, uint32_t hash_hint)
int const char const void * value
M0_INTERNAL void m0t1fs_file_lock_fini(struct m0t1fs_inode *ci)
int m0t1fs_mds_cob_unlink(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
#define container_of(ptr, type, member)
M0_INTERNAL void m0t1fs_sb_init(struct m0t1fs_sb *csb)
M0_INTERNAL struct dentry * m0t1fs_mount(struct file_system_type *fstype, int flags, const char *devname, void *data)
int m0t1fs_mds_cob_getxattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
int m0t1fs_mds_cob_setxattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL void m0t1fs_inode_cache_fini(void)
M0_INTERNAL bool m0t1fs_inode_is_dot_motr_fid(const struct inode *inode)
#define M0_TL_DESCR_DECLARE(name, scope)
M0_INTERNAL void m0t1fs_sb_fini(struct m0t1fs_sb *csb)
M0_INTERNAL struct m0_confc * m0_csb2confc(struct m0t1fs_sb *csb)
M0_INTERNAL void m0t1fs_fs_unlock(struct m0t1fs_sb *csb)
int m0t1fs_mds_cob_link(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL struct m0_file * m0_fop_to_file(struct m0_fop *fop)
M0_INTERNAL int m0t1fs_fid_getattr(const struct path *path, struct kstat *stat, uint32_t request_mask, uint32_t query_flags) M0_INTERNAL int m0t1fs_fid_getattr(struct vfsmount *mnt
static void attr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
static struct m0_cob * cob
M0_INTERNAL void m0t1fs_fs_conf_unlock(struct m0t1fs_sb *csb)
M0_INTERNAL void m0t1fs_fini(struct m0t1fs_conf *conf)
static int struct dentry * dentry
M0_INTERNAL void m0t1fs_init(struct sim *s, struct m0t1fs_conf *conf)
M0_INTERNAL int m0t1fs_ref_get_lock(struct m0t1fs_sb *csb)
int m0t1fs_setxattr(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, const void *value, size_t size, int flags) int m0t1fs_setxattr(struct dentry *dentry
struct m0_semaphore m0t1fs_cpus_sem
#define M0_TL_DECLARE(name, scope, amb_type)
const struct file_operations m0t1fs_fid_dir_file_operations
M0_INTERNAL int m0t1fs_inode_layout_rebuild(struct m0t1fs_inode *ci, struct m0_fop_cob *body)
M0_INTERNAL int m0t1fs_setattr(struct dentry *dentry, struct iattr *attr)
static struct super_block super_block
int m0t1fs_mds_cob_delxattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL void m0t1fs_kill_sb(struct super_block *sb)
int m0t1fs_mds_cob_create(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL int m0t1fs_fs_conf_lock(struct m0t1fs_sb *csb)
M0_INTERNAL void m0t1fs_fs_lock(struct m0t1fs_sb *csb)
M0_INTERNAL int m0t1fs_cob_setattr(struct inode *inode, struct m0t1fs_mdop *mo)
M0_INTERNAL bool m0t1fs_fs_is_locked(const struct m0t1fs_sb *csb)
M0_INTERNAL struct inode * m0t1fs_alloc_inode(struct super_block *sb)
int m0t1fs_fid_removexattr(struct dentry *dentry, const char *name)
const struct xattr_handler * m0t1fs_xattr_handlers[]
M0_INTERNAL int m0t1fs_cob_getattr(struct inode *inode)
m0t1fs_file_lock_init(ci, csb)
int m0t1fs_mds_cob_setattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
int m0t1fs_mds_statfs(struct m0t1fs_sb *csb, struct m0_fop **rep_fop)
static struct super_block sb
int m0t1fs_mds_cob_readdir(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL void m0t1fs_inode_update(struct inode *inode, struct m0_fop_cob *body)
int m0t1fs_inode_set_layout_id(struct m0t1fs_inode *ci, struct m0t1fs_mdop *mo, int layout_id)
const struct inode_operations m0t1fs_dir_inode_operations
M0_INTERNAL bool m0t1fs_inode_is_root(const struct inode *inode)
void m0t1fs_fid_alloc(struct m0t1fs_sb *csb, struct m0_fid *out)
const struct inode_operations m0t1fs_fid_dir_inode_operations
static struct m0_fop * fop
void m0t1fs_fid_accept(struct m0t1fs_sb *csb, const struct m0_fid *fid)
M0_INTERNAL struct m0_rpc_session * m0t1fs_container_id_to_session(const struct m0_pool_version *pver, uint64_t container_id)
#define M0_MKTIME(secs, ns)
M0_INTERNAL bool m0t1fs_inode_is_dot_motr(const struct inode *inode)
M0_INTERNAL int m0t1fs_inode_test(struct inode *inode, void *opaque)
int m0t1fs_fid_getxattr(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, void *buffer, size_t size) ssize_t m0t1fs_fid_getxattr(struct dentry *dentry
M0_INTERNAL struct inode * m0t1fs_root_iget(struct super_block *sb, const struct m0_fid *root_fid)
const struct inode_operations m0t1fs_reg_inode_operations
const struct file_operations m0t1fs_dir_file_operations
M0_INTERNAL void m0t1fs_ref_put_lock(struct m0t1fs_sb *csb)
const struct file_operations m0t1fs_reg_file_operations
M0_INTERNAL int m0t1fs_size_update(struct dentry *dentry, uint64_t newsize)
int m0t1fs_getxattr(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, void *buffer, size_t size) ssize_t m0t1fs_getxattr(struct dentry *dentry
int m0t1fs_mds_cob_listxattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL struct m0_rm_domain * m0t1fs_rm_domain_get(struct m0t1fs_sb *sb)
M0_INTERNAL int m0t1fs_fid_setxattr(const struct xattr_handler *handler, struct dentry *dentry, struct inode *inode, const char *name, const void *value, size_t size, int flags) M0_INTERNAL int m0t1fs_fid_setxattr(struct dentry *dentry