- st.st_ino = inode->i_ino;
-
- lmdp = (struct lov_user_mds_data *)arg;
- if (copy_to_user(&lmdp->lmd_st, &st, sizeof(st)))
- GOTO(out_req, rc = -EFAULT);
- }
-
- EXIT;
- out_req:
- ptlrpc_req_finished(request);
- if (filename)
- ll_putname(filename);
- return rc;
- }
- case IOC_LOV_GETINFO: {
- struct lov_user_mds_data *lumd;
- struct lov_stripe_md *lsm;
- struct lov_user_md *lum;
- struct lov_mds_md *lmm;
- int lmmsize;
- lstat_t st;
-
- lumd = (struct lov_user_mds_data *)arg;
- lum = &lumd->lmd_lmm;
-
- rc = ll_get_max_mdsize(sbi, &lmmsize);
- if (rc)
- RETURN(rc);
-
- OBD_ALLOC_LARGE(lmm, lmmsize);
- if (lmm == NULL)
- RETURN(-ENOMEM);
-
- if (copy_from_user(lmm, lum, lmmsize))
- GOTO(free_lmm, rc = -EFAULT);
-
- switch (lmm->lmm_magic) {
- case LOV_USER_MAGIC_V1:
- if (LOV_USER_MAGIC_V1 == cpu_to_le32(LOV_USER_MAGIC_V1))
- break;
- /* swab objects first so that stripes num will be sane */
- lustre_swab_lov_user_md_objects(
- ((struct lov_user_md_v1 *)lmm)->lmm_objects,
- ((struct lov_user_md_v1 *)lmm)->lmm_stripe_count);
- lustre_swab_lov_user_md_v1((struct lov_user_md_v1 *)lmm);
- break;
- case LOV_USER_MAGIC_V3:
- if (LOV_USER_MAGIC_V3 == cpu_to_le32(LOV_USER_MAGIC_V3))
- break;
- /* swab objects first so that stripes num will be sane */
- lustre_swab_lov_user_md_objects(
- ((struct lov_user_md_v3 *)lmm)->lmm_objects,
- ((struct lov_user_md_v3 *)lmm)->lmm_stripe_count);
- lustre_swab_lov_user_md_v3((struct lov_user_md_v3 *)lmm);
- break;
- default:
- GOTO(free_lmm, rc = -EINVAL);
- }
-
- rc = obd_unpackmd(sbi->ll_dt_exp, &lsm, lmm, lmmsize);
- if (rc < 0)
- GOTO(free_lmm, rc = -ENOMEM);
-
- /* Perform glimpse_size operation. */
- memset(&st, 0, sizeof(st));
-
- rc = ll_glimpse_ioctl(sbi, lsm, &st);
- if (rc)
- GOTO(free_lsm, rc);
-
- if (copy_to_user(&lumd->lmd_st, &st, sizeof(st)))
- GOTO(free_lsm, rc = -EFAULT);
-
- EXIT;
- free_lsm:
- obd_free_memmd(sbi->ll_dt_exp, &lsm);
- free_lmm:
- OBD_FREE_LARGE(lmm, lmmsize);
- return rc;
- }
- case OBD_IOC_QUOTACHECK: {
- struct obd_quotactl *oqctl;
- int error = 0;
-
- if (!cfs_capable(CFS_CAP_SYS_ADMIN) ||
- sbi->ll_flags & LL_SBI_RMT_CLIENT)
- RETURN(-EPERM);
+ st.st_ino = cl_fid_build_ino(&body->mbo_fid1,
+ sbi->ll_flags &
+ LL_SBI_32BIT_API);
+
+ if (copy_to_user(statp, &st, sizeof(st)))
+ GOTO(out_req, rc = -EFAULT);
+ } else if (cmd == IOC_MDC_GETFILEINFO ||
+ cmd == LL_IOC_MDC_GETINFO) {
+ lstatx_t stx = { 0 };
+ __u64 valid = body->mbo_valid;
+
+ stx.stx_blksize = PAGE_SIZE;
+ stx.stx_nlink = body->mbo_nlink;
+ stx.stx_uid = body->mbo_uid;
+ stx.stx_gid = body->mbo_gid;
+ stx.stx_mode = body->mbo_mode;
+ stx.stx_ino = cl_fid_build_ino(&body->mbo_fid1,
+ sbi->ll_flags &
+ LL_SBI_32BIT_API);
+ stx.stx_size = body->mbo_size;
+ stx.stx_blocks = body->mbo_blocks;
+ stx.stx_atime.tv_sec = body->mbo_atime;
+ stx.stx_ctime.tv_sec = body->mbo_ctime;
+ stx.stx_mtime.tv_sec = body->mbo_mtime;
+ stx.stx_rdev_major = MAJOR(body->mbo_rdev);
+ stx.stx_rdev_minor = MINOR(body->mbo_rdev);
+ stx.stx_dev_major = MAJOR(inode->i_sb->s_dev);
+ stx.stx_dev_minor = MINOR(inode->i_sb->s_dev);
+ stx.stx_mask |= STATX_BASIC_STATS;