22 #include <linux/version.h> 23 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 24 #include <linux/cred.h> 25 #include <linux/uidgid.h> 27 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 28 #include <linux/xattr.h> 31 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_M0T1FS 100 if (creq->
cr_rc == 0)
119 struct m0t1fs_inode *
ci);
122 struct m0t1fs_mdop *mop,
124 const struct m0t1fs_inode *,
125 const struct m0t1fs_mdop *,
129 const struct m0t1fs_inode *
inode,
130 const struct m0t1fs_mdop *mop,
134 const struct m0t1fs_inode *
inode,
135 const struct m0t1fs_mdop *mop,
139 const struct m0t1fs_inode *
inode,
140 const struct m0t1fs_mdop *mop,
143 const struct m0t1fs_inode *
inode,
144 const struct m0t1fs_mdop *mop,
153 memcpy(
tgt->s_buf,
name->b_addr, (
int)
name->b_nob);
273 struct m0t1fs_mdop *
mo,
276 struct m0t1fs_sb *
csb = M0T1FS_SB(
ci->ci_inode.i_sb);
284 if (
ci->ci_inode.i_size != 0) {
303 mo->mo_attr.ca_lid =
ci->ci_layout_id;
306 if (!
csb->csb_oostore) {
315 ci->ci_layout_changed =
true;
319 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 329 struct m0t1fs_inode *
ci = M0T1FS_I(
dentry->d_inode);
330 struct m0t1fs_sb *
csb = M0T1FS_SB(
ci->ci_inode.i_sb);
332 struct m0t1fs_mdop
mo;
338 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 344 name = handler->name;
349 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 360 mo.mo_attr.ca_pver =
ci->ci_pver;
383 char *bsptr, *wsptr, *endp;
394 bsptr = strsep(&
ptr,
";");
396 buffsize = simple_strtoul(bsptr, &endp, 0);
399 wsptr = strsep(&
ptr,
";");
401 filesize = simple_strtoul(wsptr, &endp, 0);
407 &
ci->ci_pver, buffsize);
414 if (
csb->csb_oostore) {
429 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 440 return M0_ERR(-EOPNOTSUPP);
443 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 453 struct m0t1fs_inode *
ci = M0T1FS_I(
dentry->d_inode);
454 struct m0t1fs_sb *
csb = M0T1FS_SB(
ci->ci_inode.i_sb);
456 struct m0t1fs_mdop
mo;
461 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 463 name = handler->name;
487 (
int)
size, (
int)
ci->ci_layout_id,
490 if ((
size_t)
sizeof(uint64_t) >
size) {
494 sprintf(
buffer,
"%d", (
int)
ci->ci_layout_id);
511 mo.mo_attr.ca_pver =
ci->ci_pver;
524 }
else if (
rc == -ENOENT)
535 return M0_ERR(-EOPNOTSUPP);
541 return M0_ERR(-EOPNOTSUPP);
547 return M0_ERR(-EOPNOTSUPP);
552 struct m0t1fs_inode *
ci = M0T1FS_I(
dentry->d_inode);
553 struct m0t1fs_sb *
csb = M0T1FS_SB(
ci->ci_inode.i_sb);
554 struct m0t1fs_mdop
mo;
562 if (
csb->csb_oostore)
563 return M0_RC(-EOPNOTSUPP);
582 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 591 struct nameidata *
nd)
594 return M0_ERR(-EOPNOTSUPP);
601 "component should not be longer than 32bit.",
608 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 617 struct nameidata *
nd)
621 struct m0t1fs_sb *
csb = M0T1FS_SB(
sb);
622 struct m0t1fs_inode *
ci;
623 struct m0t1fs_mdop
mo;
651 if (
csb->csb_oostore) {
655 (
char*)
dentry->d_name.name);
676 if (
dir->i_mode & S_ISGID) {
679 inode->i_mode |= S_ISGID;
682 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 702 ci->ci_layout_id = M0_DEFAULT_LAYOUT_ID;
712 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 713 mo.mo_attr.ca_uid = from_kuid(current_user_ns(),
inode->i_uid);
714 mo.mo_attr.ca_gid = from_kgid(current_user_ns(),
inode->i_gid);
716 mo.mo_attr.ca_uid =
inode->i_uid;
717 mo.mo_attr.ca_gid =
inode->i_gid;
726 mo.mo_attr.ca_pver =
ci->ci_pver;
727 mo.mo_attr.ca_lid =
ci->ci_layout_id;
759 csb_inodes_tlist_add_tail(&
csb->csb_inodes,
ci);
770 make_bad_inode(
inode);
778 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 788 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 798 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 805 struct nameidata *
nd)
808 struct m0t1fs_sb *
csb;
811 struct m0t1fs_mdop
mo;
822 csb = M0T1FS_SB(
dir->i_sb);
825 M0_LEAVE(
"ERR_PTR: %p", ERR_PTR(-ENAMETOOLONG));
826 return ERR_PTR(-ENAMETOOLONG);
833 if (
csb->csb_oostore) {
842 (
char*)
dentry->d_name.name);
888 mo.mo_attr.ca_tfid =
rep->l_body.b_tfid;
901 make_bad_inode(
inode);
909 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 916 struct nameidata *
nd)
929 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 955 struct m0t1fs_filedata *
fd;
966 if (
fd->fd_dirpos ==
NULL) {
972 fd->fd_mds_index = 0;
984 struct m0t1fs_filedata *
fd =
file->private_data;
999 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 1015 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 1023 struct m0t1fs_inode *
ci;
1024 struct m0t1fs_mdop
mo;
1025 struct m0t1fs_sb *
csb;
1030 struct m0t1fs_filedata *
fd;
1046 csb = M0T1FS_SB(
dir->i_sb);
1047 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 1053 if (
csb->csb_oostore)
1055 fd =
f->private_data;
1074 mo.mo_use_hint =
true;
1075 mo.mo_hash_hint =
fd->fd_mds_index;
1079 (
int)
mo.mo_attr.ca_name.b_nob,
1080 (
char *)
mo.mo_attr.ca_name.b_addr,
1087 "Failed to read dir from pos \"%*s\". Error %d",
1088 (
int)
mo.mo_attr.ca_name.b_nob,
1089 (
char *)
mo.mo_attr.ca_name.b_addr,
rc);
1119 " \"%.*s\", ino %lu, type %d",
1120 (
unsigned long)
f->f_pos, (
unsigned long)
ino,
1124 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 1151 (
int)
mo.mo_attr.ca_name.b_nob,
1152 (
char *)
mo.mo_attr.ca_name.b_addr,
rc);
1165 if (++
fd->fd_mds_index <
csb->csb_pools_common.pc_nr_svcs[M0_CST_MDS]) {
1187 return M0_ERR(-EOPNOTSUPP);
1193 struct m0t1fs_sb *
csb;
1194 struct m0t1fs_mdop
mo;
1195 struct m0t1fs_inode *
ci;
1197 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1198 struct timespec64 now = current_time(
inode);
1200 struct timespec now = CURRENT_TIME_SEC;
1211 return M0_ERR(-EOPNOTSUPP);
1223 mo.mo_attr.ca_nlink =
inode->i_nlink + 1;
1224 mo.mo_attr.ca_ctime = now.tv_sec;
1235 inode_inc_link_count(
inode);
1236 inode->i_ctime = now;
1237 atomic_inc(&
inode->i_count);
1250 return M0_ERR(-EOPNOTSUPP);
1255 struct m0t1fs_sb *
csb;
1257 struct m0t1fs_inode *
ci;
1258 struct m0t1fs_mdop
mo;
1259 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1260 struct timespec64 now;
1262 struct timespec now;
1283 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1284 now = current_time(
inode);
1286 now = CURRENT_TIME_SEC;
1290 mo.mo_attr.ca_nlink =
inode->i_nlink - 1;
1291 mo.mo_attr.ca_ctime = now.tv_sec;
1295 mo.mo_attr.ca_pver =
ci->ci_pver;
1297 if (
csb->csb_oostore) {
1301 inode->i_ctime =
dir->i_ctime =
dir->i_mtime = now;
1302 inode_dec_link_count(
inode);
1306 "ioservice delete fop failed: %d, gob fid " 1309 ci->ci_inode.i_size);
1333 if (
mo.mo_attr.ca_nlink == 0 &&
ci->ci_inode.i_size > 0) {
1344 mo.mo_attr.ca_ctime = now.tv_sec;
1345 mo.mo_attr.ca_mtime = now.tv_sec;
1349 mo.mo_attr.ca_pver =
ci->ci_pver;
1357 inode->i_ctime =
dir->i_ctime =
dir->i_mtime = now;
1358 inode_dec_link_count(
inode);
1371 return M0_ERR(-EOPNOTSUPP);
1382 inode_dec_link_count(
dentry->d_inode);
1391 struct m0t1fs_inode *
ci = M0T1FS_I(
inode);
1392 struct m0t1fs_sb *
csb = M0T1FS_SB(
inode->i_sb);
1416 #ifdef HAVE_INODE_BLKSIZE 1426 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) 1428 uint32_t request_mask, uint32_t query_flags)
1434 struct m0t1fs_sb *
csb;
1438 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) 1461 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) 1462 M0_INTERNAL
int m0t1fs_getattr(
const struct path *path,
struct kstat *
stat,
1463 uint32_t request_mask, uint32_t query_flags)
1465 M0_INTERNAL
int m0t1fs_getattr(
struct vfsmount *mnt,
struct dentry *
dentry,
1470 struct m0t1fs_sb *
csb;
1473 struct m0t1fs_inode *
ci;
1474 struct m0t1fs_mdop
mo;
1477 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,11,0) 1496 if (
csb->csb_oostore) {
1527 struct m0t1fs_sb *
csb;
1529 struct m0t1fs_inode *
ci;
1530 struct m0t1fs_mdop
mo;
1539 if (
csb->csb_oostore) {
1540 inode->i_size = newsize;
1545 mo.mo_attr.ca_size = newsize;
1553 inode->i_size = newsize;
1560 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1572 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1577 return M0_ERR(-EOPNOTSUPP);
1580 M0_INTERNAL
int m0t1fs_fid_setattr(
struct dentry *
dentry,
struct iattr *
attr)
1583 return M0_ERR(-EOPNOTSUPP);
1588 struct m0t1fs_sb *
csb;
1590 struct m0t1fs_inode *
ci;
1591 struct m0t1fs_mdop
mo;
1605 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 1617 if (!
csb->csb_oostore) {
1625 mo.mo_attr.ca_pver =
ci->ci_pver;
1635 mo.mo_attr.ca_lid =
ci->ci_layout_id;
1642 if (
attr->ia_valid & ATTR_CTIME) {
1643 mo.mo_attr.ca_ctime =
attr->ia_ctime.tv_sec;
1647 if (
attr->ia_valid & ATTR_MTIME) {
1648 mo.mo_attr.ca_mtime =
attr->ia_mtime.tv_sec;
1652 if (
attr->ia_valid & ATTR_ATIME) {
1653 mo.mo_attr.ca_atime =
attr->ia_atime.tv_sec;
1657 if (
attr->ia_valid & ATTR_SIZE) {
1658 mo.mo_attr.ca_size =
attr->ia_size;
1662 if (
attr->ia_valid & ATTR_MODE) {
1663 mo.mo_attr.ca_mode =
attr->ia_mode;
1667 if (
attr->ia_valid & ATTR_UID) {
1668 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 1669 mo.mo_attr.ca_uid = from_kuid(current_user_ns(),
attr->ia_uid);
1671 mo.mo_attr.ca_uid =
attr->ia_uid;
1676 if (
attr->ia_valid & ATTR_GID) {
1677 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 1678 mo.mo_attr.ca_gid = from_kgid(current_user_ns(),
attr->ia_gid);
1680 mo.mo_attr.ca_gid =
attr->ia_gid;
1685 mo.mo_attr.ca_nlink =
inode->i_nlink;
1696 if (!
csb->csb_oostore) {
1706 if (
attr->ia_valid & ATTR_SIZE &&
attr->ia_size <
inode->i_size) {
1712 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 1714 if (
attr->ia_valid & ATTR_SIZE)
1722 if (!
csb->csb_oostore)
1731 struct m0t1fs_inode *
ci)
1733 struct m0t1fs_sb *
csb;
1736 csb = M0T1FS_SB(
ci->ci_inode.i_sb);
1756 struct m0t1fs_mdop *mop,
1758 const struct m0t1fs_inode *,
1759 const struct m0t1fs_mdop *,
1762 struct m0t1fs_sb *
csb;
1766 const char *op_name;
1778 csb = M0T1FS_SB(
ci->ci_inode.i_sb);
1779 pc = &
csb->csb_pools_common;
1782 csb->csb_oostore ?
"oostore mode" :
"",
1809 ci->ci_inode.i_size <= 0)
1834 const struct m0t1fs_mdop *
mo,
1857 req->b_pfid =
mo->mo_attr.ca_pfid;
1858 req->b_tfid =
mo->mo_attr.ca_tfid;
1859 req->b_pver =
mo->mo_attr.ca_pver;
1867 req->b_pfid =
mo->mo_attr.ca_pfid;
1868 req->b_tfid =
mo->mo_attr.ca_tfid;
1876 req->b_pfid =
mo->mo_attr.ca_pfid;
1877 req->b_tfid =
mo->mo_attr.ca_tfid;
1889 req->b_pfid =
mo->mo_attr.ca_pfid;
1896 req->b_tfid =
mo->mo_attr.ca_tfid;
1902 req->b_tfid =
mo->mo_attr.ca_tfid;
1909 req->b_tfid =
mo->mo_attr.ca_tfid;
1916 req->b_tfid =
mo->mo_attr.ca_tfid;
1919 &
mo->mo_attr.ca_eaval);
1925 req->b_tfid =
mo->mo_attr.ca_tfid;
1932 req->b_tfid =
mo->mo_attr.ca_tfid;
1938 req->b_tfid =
mo->mo_attr.ca_tfid;
1950 const struct m0t1fs_mdop *
mo,
1988 mo->mo_attr.ca_name.b_addr,
1989 mo->mo_attr.ca_name.b_nob,
2008 "%p[%u] m0t1fs_mds_cob_fop_populate() failed with %d",
2013 M0_LOG(
M0_DEBUG,
"%p[%u] Send md operation to session %p (sid=%lu)",
2035 rc =
u.create_rep->c_body.b_rc;
2036 remid = &
u.create_rep->c_mod_rep.fmr_remid;
2040 rc =
u.statfs_rep->f_rc;
2044 rc =
u.lookup_rep->l_body.b_rc;
2048 rc =
u.link_rep->l_body.b_rc;
2049 remid = &
u.link_rep->l_mod_rep.fmr_remid;
2053 rc =
u.unlink_rep->u_body.b_rc;
2054 remid = &
u.unlink_rep->u_mod_rep.fmr_remid;
2058 rc =
u.rename_rep->r_body.b_rc;
2059 remid = &
u.rename_rep->r_mod_rep.fmr_remid;
2063 rc =
u.setattr_rep->s_body.b_rc;
2064 remid = &
u.setattr_rep->s_mod_rep.fmr_remid;
2068 rc =
u.getattr_rep->g_body.b_rc;
2072 rc =
u.open_rep->o_body.b_rc;
2073 remid = &
u.open_rep->o_mod_rep.fmr_remid;
2077 rc =
u.close_rep->c_body.b_rc;
2081 rc =
u.readdir_rep->r_body.b_rc;
2085 rc =
u.setxattr_rep->s_body.b_rc;
2086 remid = &
u.setxattr_rep->s_mod_rep.fmr_remid;
2090 rc =
u.getxattr_rep->g_body.b_rc;
2094 rc =
u.listxattr_rep->l_body.b_rc;
2098 rc =
u.delxattr_rep->d_body.b_rc;
2099 remid = &
u.delxattr_rep->d_mod_rep.fmr_remid;
2121 struct m0t1fs_mdop
mo;
2127 const struct m0t1fs_mdop *
mo,
2134 const struct m0t1fs_mdop *
mo,
2141 const struct m0t1fs_mdop *
mo,
2148 const struct m0t1fs_mdop *
mo,
2155 const struct m0t1fs_mdop *
mo,
2162 const struct m0t1fs_mdop *
mo,
2169 const struct m0t1fs_mdop *
mo,
2176 const struct m0t1fs_mdop *
mo,
2183 const struct m0t1fs_mdop *
mo,
2190 const struct m0t1fs_mdop *
mo,
2197 const struct m0t1fs_mdop *
mo,
2204 const struct m0t1fs_mdop *mop,
2227 common->
c_pver = mop->mo_attr.ca_pver;
2236 ct->
ct_size = mop->mo_attr.ca_size;
2254 M0_LOG(
M0_DEBUG,
"%p[%u] ri_error %d, cob_req_fop %p, cr_rc %d, " 2265 const struct m0t1fs_inode *
ci,
2266 const struct m0t1fs_mdop *mop,
2271 struct m0t1fs_sb *
csb;
2285 csb = M0T1FS_SB(
ci->ci_inode.i_sb);
2292 " with gob "FID_F" is unavailable." 2293 " Has configuration got updated?",
2354 const struct m0t1fs_inode *
inode,
2355 const struct m0t1fs_mdop *mop,
2362 const struct m0t1fs_inode *
inode,
2363 const struct m0t1fs_mdop *mop,
2370 const struct m0t1fs_inode *
inode,
2371 const struct m0t1fs_mdop *mop,
2379 const struct m0t1fs_inode *
inode,
2380 const struct m0t1fs_mdop *mop,
2388 struct m0t1fs_sb *
csb;
2389 struct m0t1fs_inode *
ci;
2397 struct m0t1fs_mdop
mo;
2408 for (
i = 0;
i <
csb->csb_pools_common.pc_md_redundancy;
i++) {
2413 if (
rc == -ECANCELED)
2433 mo.mo_attr.ca_pver =
ci->ci_pver;
2448 if (
rc == -ECANCELED)
2479 struct m0t1fs_inode *
ci = M0T1FS_I(
inode);
2480 struct m0t1fs_sb *
csb = M0T1FS_SB(
inode->i_sb);
2495 #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0) 2510 .name =
"writesize",
2523 .name =
"fid_writesize",
2540 .read = generic_read_dir,
2543 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 2549 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 2550 .fsync = generic_file_fsync,
2552 .fsync = simple_fsync,
2554 .llseek = generic_file_llseek,
2558 .read = generic_read_dir,
2561 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0) 2566 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,10,0) 2567 .fsync = generic_file_fsync,
2569 .fsync = simple_fsync,
2571 .llseek = generic_file_llseek,
2582 .getattr = m0t1fs_getattr,
2584 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0) 2599 .setattr = m0t1fs_fid_setattr,
2601 #if LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0) 2606 .listxattr = m0t1fs_fid_listxattr,
2609 #undef M0_TRACE_SUBSYSTEM
m0_fop_put0_lock(rep_fop)
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)
static int m0t1fs_releasedir(struct inode *inode, struct file *file)
const struct xattr_handler m0t1fs_xattr_lid
M0_INTERNAL int m0_rpc_post(struct m0_rpc_item *item)
struct m0_fop_type m0_fop_setxattr_fopt
static void ptr(struct m0_addb2__context *ctx, const uint64_t *v, char *buf)
static struct m0_fid gob_fid
uint32_t m0_fop_opcode(const struct m0_fop *fop)
m0_time_t ri_resend_interval
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
M0_INTERNAL void m0_fid_gob_make(struct m0_fid *gob_fid, uint32_t container, uint64_t key)
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)
M0_INTERNAL struct m0_fop_cob_common * m0_cobfop_common_get(struct m0_fop *fop)
int const char const void size_t int flags
M0_INTERNAL int struct dentry struct kstat * stat
M0_INTERNAL uint64_t m0_fid_hash(const struct m0_fid *fid)
struct m0_dirent * dirent_next(struct m0_dirent *ent)
static int name_mem2wire(struct m0_fop_str *tgt, const struct m0_buf *name)
const m0_time_t M0_TIME_NEVER
M0_INTERNAL struct m0_pool_version * m0_pool_version_find(struct m0_pools_common *pc, const struct m0_fid *id)
static struct io_request req
M0_INTERNAL void m0_fop_init(struct m0_fop *fop, struct m0_fop_type *fopt, void *data, void(*fop_release)(struct m0_ref *))
struct m0_pool_version * pv
static int m0t1fs_rmdir(struct inode *dir, struct dentry *dentry)
static void file_lock_release(struct m0_rm_incoming *rm_in)
static int m0t1fs_link(struct dentry *old, struct inode *dir, struct dentry *new)
struct m0_fop_type m0_fop_statfs_fopt
M0_INTERNAL const struct m0_fid * m0t1fs_inode_fid(const struct m0t1fs_inode *ci)
M0_INTERNAL uint32_t m0_bitstring_len_get(const struct m0_bitstring *c)
int m0t1fs_mds_cob_getattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL void m0_buf_init(struct m0_buf *buf, void *data, uint32_t nob)
struct m0_fop_type m0_fop_getattr_fopt
const struct address_space_operations m0t1fs_aops
static int m0t1fs_mds_cob_fop_populate(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop *fop)
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
const struct m0_fid_type m0_file_fid_type
M0_INTERNAL bool m0_is_cob_truncate_fop(const struct m0_fop *fop)
static void cfop_release(struct m0_ref *ref)
void * m0_fop_data(const struct m0_fop *fop)
static int m0t1fs_ios_cob_create(struct cob_req *cr, const struct m0t1fs_inode *inode, const struct m0t1fs_mdop *mop, int idx)
M0_INTERNAL void m0_file_lock(struct m0_rm_owner *owner, struct m0_rm_incoming *req)
struct m0_fop_type m0_fop_create_fopt
static const struct xattr_handler m0t1fs_xattr_fid_writesize
struct m0t1fs_sb * cr_csb
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)
struct m0_rm_credit rin_want
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
static int m0t1fs_fid_link(struct dentry *old, struct inode *dir, struct dentry *new)
M0_ADDB2_ADD(M0_AVI_FS_CREATE, new_fid.f_container, new_fid.f_key, mode, rc)
int m0t1fs_mds_cob_getxattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
struct m0_fop_type m0_fop_getxattr_fopt
static int m0t1fs_ios_cob_op(struct cob_req *cr, const struct m0t1fs_inode *ci, const struct m0t1fs_mdop *mop, int idx, struct m0_fop_type *ftype)
M0_INTERNAL bool m0_fid_is_set(const struct m0_fid *fid)
static struct m0_rpc_item * item
struct m0_fop_getxattr_rep * rep
static int struct dentry int struct nameidata * nd
int m0t1fs_mds_cob_setxattr(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
static int m0t1fs_fid_releasedir(struct inode *inode, struct file *file)
static struct m0_pools_common pc
M0_INTERNAL void m0t1fs_inode_bob_init(struct m0t1fs_inode *bob)
static void body_wire2mem(struct m0_cob_attr *attr, const struct m0_fop_cob *body)
M0_INTERNAL int m0_sm_timedwait(struct m0_sm *mach, uint64_t states, m0_time_t deadline)
int const char const void size_t size
M0_LOG(M0_DEBUG, "Creating \s\in pdir %lu "FID_F,(char *) dentry->d_name.name, dir->i_ino, FID_P(m0t1fs_inode_fid(M0T1FS_I(dir))))
struct m0_fop_type m0_fop_cob_getattr_fopt
M0_INTERNAL bool m0t1fs_inode_bob_check(struct m0t1fs_inode *bob)
static int m0t1fs_fid_opendir(struct inode *inode, struct file *file)
struct m0_fop_type * f_type
M0_INTERNAL bool m0_is_cob_setattr_fop(const struct m0_fop *fop)
static int m0t1fs_inode_update_stat(struct inode *inode, struct m0_fop_cob *body, struct kstat *stat)
static int64_t max64(int64_t a, int64_t b)
M0_INTERNAL void m0t1fs_fs_unlock(struct m0t1fs_sb *csb)
M0_INTERNAL void m0_fid_set(struct m0_fid *fid, uint64_t container, uint64_t key)
#define M0_ERR_INFO(rc, fmt,...)
static int m0t1fs_ios_cob_setattr(struct cob_req *cr, const struct m0t1fs_inode *inode, const struct m0t1fs_mdop *mop, int idx)
struct m0_fop_cob cgr_body
return M0_ERR(-EOPNOTSUPP)
M0_INTERNAL const char * m0_fop_name(const struct m0_fop *fop)
static int m0t1fs_component_objects_op(struct m0t1fs_inode *ci, struct m0t1fs_mdop *mop, int(*func)(struct cob_req *, const struct m0t1fs_inode *, const struct m0t1fs_mdop *, int idx))
static int m0t1fs_unlink(struct inode *dir, struct dentry *dentry)
int m0t1fs_mds_cob_link(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
uint32_t pc_md_redundancy
M0_INTERNAL int m0_pool_version_get(struct m0_pools_common *pc, const struct m0_fid *pool, struct m0_pool_version **pv)
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)
M0_INTERNAL void m0_bitstring_copy(struct m0_bitstring *dst, const char *src, size_t count)
static int void filldir_t filldir
struct m0_fop_type m0_fop_cob_setattr_fopt
M0_INTERNAL void m0t1fs_fs_conf_unlock(struct m0t1fs_sb *csb)
static int struct dentry * dentry
struct m0_fop_type m0_fop_unlink_fopt
static int m0t1fs_fid_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) static int m0t1fs_fid_create(struct inode *dir
struct m0_rpc_machine * m0_fop_session_machine(const struct m0_rpc_session *s)
#define M0_ADDB2_OBJ(obj)
M0_INTERNAL int m0t1fs_ref_get_lock(struct m0t1fs_sb *csb)
M0_INTERNAL struct m0_rpc_session * m0_reqh_mdpool_service_index_to_session(const struct m0_reqh *reqh, const struct m0_fid *gob_fid, uint32_t index)
struct m0_semaphore cr_sem
static int m0t1fs_fid_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) static int m0t1fs_fid_mkdir(struct inode *dir
static int m0t1fs_ios_cob_fop_populate(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mop, struct m0_fop *fop, const struct m0_fid *cob_fid, const struct m0_fid *gob_fid, uint32_t cob_idx)
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
static struct m0_fid cob_fid
static struct dentry * m0t1fs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) static struct dentry *m0t1fs_lookup(struct inode *dir
struct m0_fop * m0_fop_get(struct m0_fop *fop)
static int file_lock_acquire(struct m0_rm_incoming *rm_in, struct m0t1fs_inode *ci)
const struct m0_rpc_item_type * ri_type
struct m0_rpc_item * ri_reply
M0_INTERNAL int m0_semaphore_init(struct m0_semaphore *semaphore, unsigned value)
static struct m0_fop_fsync_rep reply_data
void * m0_alloc(size_t size)
static int m0t1fs_ios_cob_truncate(struct cob_req *cr, const struct m0t1fs_inode *inode, const struct m0t1fs_mdop *mop, int idx)
static int m0t1fs_fid_readdir(struct file *f, struct dir_context *ctx)
M0_INTERNAL uint32_t m0_fid_cob_device_id(const struct m0_fid *cob_fid)
int m0_rpc_post_sync(struct m0_fop *fop, struct m0_rpc_session *session, const struct m0_rpc_item_ops *ri_ops, m0_time_t deadline)
m0_addb2_add(M0_AVI_FS_LOOKUP, M0_ADDB2_OBJ(&M0T1FS_I(dir) ->ci_fid))
const struct file_operations m0t1fs_fid_dir_file_operations
static int struct dentry int mode
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)
return dcache_splice static d_splice_alias(inode, dentry) struct dentry * m0t1fs_fid_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags) static struct dentry *m0t1fs_fid_lookup(struct inode *dir
M0_INTERNAL int m0_fop_data_alloc(struct m0_fop *fop)
int m0t1fs_mds_cob_create(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
M0_INTERNAL void m0_fop_fini(struct m0_fop *fop)
static void cob_rpc_item_cb(struct m0_rpc_item *item)
M0_INTERNAL int m0_fid_sscanf(const char *s, struct m0_fid *fid)
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)
static int m0t1fs_fid_check(struct m0_fid *fid)
static struct fdmi_ctx ctx
M0_INTERNAL bool m0t1fs_fs_is_locked(const struct m0t1fs_sb *csb)
static int m0t1fs_readdir(struct file *f, struct dir_context *ctx) static int m0t1fs_readdir(struct file *f
M0_INTERNAL bool m0_is_cob_create_fop(const struct m0_fop *fop)
const struct xattr_handler m0t1fs_xattr_pver
int m0t1fs_fid_removexattr(struct dentry *dentry, const char *name)
const struct xattr_handler * m0t1fs_xattr_handlers[]
struct m0_fop_type m0_fop_listxattr_fopt
void(* rio_replied)(struct m0_rpc_item *item)
struct m0_dirent * dirent_first(struct m0_fop_readdir_rep *rep)
struct m0_fop_str g_value
M0_INTERNAL int m0t1fs_cob_getattr(struct inode *inode)
static int m0t1fs_ios_cob_delete(struct cob_req *cr, const struct m0t1fs_inode *inode, const struct m0t1fs_mdop *mop, int idx)
M0_INTERNAL int m0_rpc_session_validate(struct m0_rpc_session *session)
m0t1fs_file_lock_init(ci, csb)
static int m0t1fs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) static int m0t1fs_mkdir(struct inode *dir
int32_t m0_rpc_item_error(const struct m0_rpc_item *item)
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 const struct xattr_handler m0t1fs_xattr_fid_lid
struct m0_pdclust_tgt_addr tgt
M0_INTERNAL int64_t m0_layout_find_by_buffsize(struct m0_layout_domain *dom, struct m0_fid *pver, size_t buffsize)
static struct super_block sb
M0_INTERNAL int64_t m0_ref_read(const struct m0_ref *ref)
int m0t1fs_mds_cob_readdir(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop **rep_fop)
struct m0_fop_str s_value
M0_INTERNAL void m0_file_unlock(struct m0_rm_incoming *req)
struct m0_fop_type m0_fop_setattr_fopt
M0_INTERNAL void m0t1fs_inode_update(struct inode *inode, struct m0_fop_cob *body)
struct m0_fop_type m0_fop_readdir_fopt
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL void m0_semaphore_fini(struct m0_semaphore *semaphore)
const struct m0_rpc_item_ops * ri_ops
int m0t1fs_inode_set_layout_id(struct m0t1fs_inode *ci, struct m0t1fs_mdop *mo, int layout_id)
m0_time_t m0_time_from_now(uint64_t secs, long ns)
const struct inode_operations m0t1fs_dir_inode_operations
M0_INTERNAL bool m0t1fs_inode_is_root(const struct inode *inode)
struct m0_rpc_session * ri_session
void m0t1fs_fid_alloc(struct m0t1fs_sb *csb, struct m0_fid *out)
struct m0_fop_type m0_fop_cob_create_fopt
M0_INTERNAL void * m0_bitstring_buf_get(struct m0_bitstring *c)
struct m0_rpc_item * m0_fop_to_rpc_item(const struct m0_fop *fop)
M0_ENTRY("Setting %.*s's xattr %s=%.*s", dentry->d_name.len,(char *) dentry->d_name.name, name,(int) size,(char *) value)
struct m0_fop * m0_fop_alloc_at(struct m0_rpc_session *sess, struct m0_fop_type *fopt)
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)
d_instantiate(dentry, inode)
const struct m0_uint128 m0_rm_m0t1fs_group
struct m0_fop * m0_rpc_item_to_fop(const struct m0_rpc_item *item)
struct m0t1fs_filedata * fd
struct m0_fop_type m0_fop_delxattr_fopt
M0_INTERNAL void m0_rm_owner_unlock(struct m0_rm_owner *owner)
M0_INTERNAL struct m0_rpc_session * m0t1fs_container_id_to_session(const struct m0_pool_version *pver, uint64_t container_id)
static int m0t1fs_fid_rmdir(struct inode *dir, struct dentry *dentry)
struct m0_fop_type m0_fop_lookup_fopt
M0_INTERNAL void m0_semaphore_down(struct m0_semaphore *semaphore)
const struct xattr_handler m0t1fs_xattr_writesize
static const struct m0_rpc_item_ops cob_item_ops
M0_INTERNAL int m0t1fs_inode_test(struct inode *inode, void *opaque)
M0_INTERNAL void m0_fid_convert_gob2cob(const struct m0_fid *gob_fid, struct m0_fid *cob_fid, uint32_t device_id)
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 bool m0_is_cob_delete_fop(const struct m0_fop *fop)
M0_INTERNAL void m0_rm_owner_lock(struct m0_rm_owner *owner)
M0_INTERNAL void m0_semaphore_up(struct m0_semaphore *semaphore)
struct m0_uint128 cr_group_id
static int m0t1fs_fid_unlink(struct inode *dir, struct dentry *dentry)
M0_INTERNAL bool m0_fid_is_valid(const struct m0_fid *fid)
struct m0_fop_type m0_fop_cob_truncate_fopt
struct m0_rpc_machine * ri_rmachine
M0_INTERNAL void m0_dump_cob_attr(const struct m0_cob_attr *attr)
static int m0t1fs_opendir(struct inode *inode, struct file *file)
static struct m0_dtm_oper_descr reply
const struct inode_operations m0t1fs_reg_inode_operations
const struct file_operations m0t1fs_dir_file_operations
struct m0_rpc_item f_item
struct m0_pdclust_attr pv_attr
M0_INTERNAL void m0t1fs_ref_put_lock(struct m0t1fs_sb *csb)
const struct file_operations m0t1fs_reg_file_operations
M0_INTERNAL void m0_poolmach_gob2cob(struct m0_poolmach *pm, const struct m0_fid *gfid, uint32_t idx, struct m0_fid *cob_fid)
M0_INTERNAL int m0t1fs_size_update(struct dentry *dentry, uint64_t newsize)
void m0t1fs_fsync_record_update(struct m0_reqh_service_ctx *service, struct m0t1fs_sb *csb, struct m0t1fs_inode *inode, struct m0_be_tx_remid *btr)
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)
static int m0t1fs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) static int m0t1fs_create(struct inode *dir
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
static int m0t1fs_mds_cob_op(struct m0t1fs_sb *csb, const struct m0t1fs_mdop *mo, struct m0_fop_type *ftype, struct m0_fop **rep_fop)
struct m0_fop_type m0_fop_cob_delete_fopt
M0_INTERNAL void m0_fid_tassume(struct m0_fid *fid, const struct m0_fid_type *ft)
M0_INTERNAL struct m0_reqh_service_ctx * m0_reqh_service_ctx_from_session(struct m0_rpc_session *session)
struct m0_fop_type m0_fop_link_fopt
static void body_mem2wire(struct m0_fop_cob *body, const struct m0_cob_attr *attr, int valid)