Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0cf21ab authored by John L. Hammond's avatar John L. Hammond Committed by Greg Kroah-Hartman
Browse files

staging: lustre: clio: add CIT_DATA_VERSION and remove IOC_LOV_GETINFO



During development a new api, cl_object_obd_info_get()
and cl_object_data_version() which then were later
replaced by a better solution CIT_DATA_VERSION. For
the case of the upstream client their is no point in
introducing a API to only have it removed later. Due
to the way the patches landed with their dependencies
it is not possible to separate out two patches. These
two combined patches do the following:

 * Add a new cl_io type CIT_DATA_VERSION to get file
   data version.
 * Remove the unused IOC_LOV_GETINFO ioctl.
 * Remove ll_glimpse_ioctl() and ll_lsm_getattr().
 * Remove the OBD API method obd_getattr_async().

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Signed-off-by: default avatarBobi Jam <bobijam.xu@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5823
Reviewed-on: http://review.whamcloud.com/12748
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6356
Reviewed-on: http://review.whamcloud.com/14649


Reviewed-by: default avatarHenri Doreau <henri.doreau@cea.fr>
Reviewed-by: default avatarJinshan Xiong <jinshan.xiong@intel.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e3d86358
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -1373,6 +1373,8 @@ enum cl_io_type {
	CIT_WRITE,
	/** truncate, utime system calls */
	CIT_SETATTR,
	/** get data version */
	CIT_DATA_VERSION,
	/**
	 * page fault handling
	 */
@@ -1777,6 +1779,10 @@ struct cl_io {
			int		sa_stripe_index;
			const struct lu_fid	*sa_parent_fid;
		} ci_setattr;
		struct cl_data_version_io {
			u64 dv_data_version;
			int dv_flags;
		} ci_data_version;
		struct cl_fault_io {
			/** page index within file. */
			pgoff_t	 ft_index;
+5 −1
Original line number Diff line number Diff line
@@ -63,9 +63,13 @@
#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
typedef struct stat64   lstat_t;
#define lstat_f  lstat64
#define fstat_f		fstat64
#define fstatat_f	fstatat64
#else
typedef struct stat     lstat_t;
#define lstat_f  lstat
#define fstat_f		fstat
#define fstatat_f	fstatat
#endif

#define HAVE_LOV_USER_MDS_DATA
@@ -234,7 +238,7 @@ struct ost_id {
/* #define LL_IOC_POLL_QUOTACHECK	161 OBD_IOC_POLL_QUOTACHECK */
/* #define LL_IOC_QUOTACTL		162 OBD_IOC_QUOTACTL */
#define IOC_OBD_STATFS		  _IOWR('f', 164, struct obd_statfs *)
#define IOC_LOV_GETINFO		 _IOWR('f', 165, struct lov_user_mds_data *)
/*	IOC_LOV_GETINFO			165 obsolete */
#define LL_IOC_FLUSHCTX		 _IOW('f', 166, long)
/* LL_IOC_RMTACL			167 obsolete */
#define LL_IOC_GETOBDCOUNT	      _IOR('f', 168, long)
+0 −2
Original line number Diff line number Diff line
@@ -905,8 +905,6 @@ struct obd_ops {
		       struct obd_info *oinfo, struct obd_trans_info *oti);
	int (*getattr)(const struct lu_env *env, struct obd_export *exp,
		       struct obd_info *oinfo);
	int (*getattr_async)(struct obd_export *exp, struct obd_info *oinfo,
			     struct ptlrpc_request_set *set);
	int (*preprw)(const struct lu_env *env, int cmd,
		      struct obd_export *exp, struct obdo *oa, int objcount,
		      struct obd_ioobj *obj, struct niobuf_remote *remote,
+0 −13
Original line number Diff line number Diff line
@@ -721,19 +721,6 @@ static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
	return rc;
}

static inline int obd_getattr_async(struct obd_export *exp,
				    struct obd_info *oinfo,
				    struct ptlrpc_request_set *set)
{
	int rc;

	EXP_CHECK_DT_OP(exp, getattr_async);
	EXP_COUNTER_INCREMENT(exp, getattr_async);

	rc = OBP(exp->exp_obd, getattr_async)(exp, oinfo, set);
	return rc;
}

static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
			      struct obd_info *oinfo,
			      struct obd_trans_info *oti)
+0 −71
Original line number Diff line number Diff line
@@ -1369,77 +1369,6 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
			ll_putname(filename);
		return rc;
	}
	case IOC_LOV_GETINFO: {
		struct lov_user_mds_data __user *lumd;
		struct lov_stripe_md *lsm;
		struct lov_user_md __user *lum;
		struct lov_mds_md *lmm;
		int lmmsize;
		lstat_t st;

		lumd = (struct lov_user_mds_data __user *)arg;
		lum = &lumd->lmd_lmm;

		rc = ll_get_max_mdsize(sbi, &lmmsize);
		if (rc)
			return rc;

		lmm = libcfs_kvzalloc(lmmsize, GFP_NOFS);
		if (!lmm)
			return -ENOMEM;
		if (copy_from_user(lmm, lum, lmmsize)) {
			rc = -EFAULT;
			goto free_lmm;
		}

		switch (lmm->lmm_magic) {
		case LOV_USER_MAGIC_V1:
			if (cpu_to_le32(LOV_USER_MAGIC_V1) == 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 (cpu_to_le32(LOV_USER_MAGIC_V3) == 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:
			rc = -EINVAL;
			goto free_lmm;
		}

		rc = obd_unpackmd(sbi->ll_dt_exp, &lsm, lmm, lmmsize);
		if (rc < 0) {
			rc = -ENOMEM;
			goto free_lmm;
		}

		/* Perform glimpse_size operation. */
		memset(&st, 0, sizeof(st));

		rc = ll_glimpse_ioctl(sbi, lsm, &st);
		if (rc)
			goto free_lsm;

		if (copy_to_user(&lumd->lmd_st, &st, sizeof(st))) {
			rc = -EFAULT;
			goto free_lsm;
		}

free_lsm:
		obd_free_memmd(sbi->ll_dt_exp, &lsm);
free_lmm:
		kvfree(lmm);
		return rc;
	}
	case OBD_IOC_QUOTACHECK: {
		struct obd_quotactl *oqctl;
		int error = 0;
Loading