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

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

staging: lustre: obd: remove destroy cookie handling



Clients no longer need to track the max and default MDS cookiesizes
so remove
 the obsolete obod o_valid flag OBD_MD_FLCOOKIE,
 the struct client_obd members cl_{default,max}_mds_cookiesize,
 the struct obd_trans_info and parameters of this type,
 the cookiesize parameters from md_init_ea_size(),
 the files llite/*/{default,max}_cookiesize, and
 any code that needlessly handled these values.

Signed-off-by: default avatarJohn L. Hammond <john.hammond@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6017
Reviewed-on: http://review.whamcloud.com/12922


Reviewed-by: default avatarLai Siyao <lai.siyao@intel.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarAlex Zhuravlev <alexey.zhuravlev@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e57721e7
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -1664,7 +1664,7 @@ lov_mds_md_max_stripe_count(size_t buf_size, __u32 lmm_magic)
#define OBD_MD_FLCKSUM     (0x00100000ULL) /* bulk data checksum */
#define OBD_MD_FLQOS       (0x00200000ULL) /* quality of service stats */
/*#define OBD_MD_FLOSCOPQ    (0x00400000ULL) osc opaque data, never used */
#define OBD_MD_FLCOOKIE    (0x00800000ULL) /* log cancellation cookie */
/*	OBD_MD_FLCOOKIE    (0x00800000ULL) obsolete in 2.8 */
#define OBD_MD_FLGROUP     (0x01000000ULL) /* group */
#define OBD_MD_FLFID       (0x02000000ULL) /* ->ost write inline fid */
#define OBD_MD_FLEPOCH     (0x04000000ULL) /* ->ost write with ioepoch */
@@ -2091,7 +2091,7 @@ struct mdt_body {
	__u32	mbo_eadatasize;
	__u32	mbo_aclsize;
	__u32	mbo_max_mdsize;
	__u32	mbo_max_cookiesize;
	__u32	mbo_unused3;	/* was max_cookiesize until 2.8 */
	__u32	mbo_uid_h;	/* high 32-bits of uid, for FUID */
	__u32	mbo_gid_h;	/* high 32-bits of gid, for FUID */
	__u32	mbo_padding_5;	/* also fix lustre_swab_mdt_body */
@@ -3226,7 +3226,8 @@ struct obdo {
	__u32		   o_parent_ver;
	struct lustre_handle    o_handle;  /* brw: lock handle to prolong locks
					    */
	struct llog_cookie      o_lcookie; /* destroy: unlink cookie from MDS
	struct llog_cookie      o_lcookie; /* destroy: unlink cookie from MDS,
					    * obsolete in 2.8, reused in OSP
					    */
	__u32			o_uid_h;
	__u32			o_gid_h;
+6 −14
Original line number Diff line number Diff line
@@ -157,15 +157,14 @@ static inline void mdc_put_rpc_lock(struct mdc_rpc_lock *lck,
}

/**
 * Update the maximum possible easize and cookiesize.
 * Update the maximum possible easize.
 *
 * The values are learned from ptlrpc replies sent by the MDT.  The
 * default easize and cookiesize is initialized to the minimum value but
 * allowed to grow up to a single page in size if required to handle the
 * This value is learned from ptlrpc replies sent by the MDT. The
 * default easize is initialized to the minimum value but allowed
 * to grow up to a single page in size if required to handle the
 * common case.
 *
 * \see client_obd::cl_default_mds_easize and
 * client_obd::cl_default_mds_cookiesize
 * \see client_obd::cl_default_mds_easize
 *
 * \param[in] exp	export for MDC device
 * \param[in] body	body of ptlrpc reply from MDT
@@ -176,7 +175,7 @@ static inline void mdc_update_max_ea_from_body(struct obd_export *exp,
{
	if (body->mbo_valid & OBD_MD_FLMODEASIZE) {
		struct client_obd *cli = &exp->exp_obd->u.cli;
		u32 def_cookiesize, def_easize;
		u32 def_easize;

		if (cli->cl_max_mds_easize < body->mbo_max_mdsize)
			cli->cl_max_mds_easize = body->mbo_max_mdsize;
@@ -184,13 +183,6 @@ static inline void mdc_update_max_ea_from_body(struct obd_export *exp,
		def_easize = min_t(__u32, body->mbo_max_mdsize,
				   OBD_MAX_DEFAULT_EA_SIZE);
		cli->cl_default_mds_easize = def_easize;

		if (cli->cl_max_mds_cookiesize < body->mbo_max_cookiesize)
			cli->cl_max_mds_cookiesize = body->mbo_max_cookiesize;

		def_cookiesize = min_t(__u32, body->mbo_max_cookiesize,
				       OBD_MAX_DEFAULT_COOKIE_SIZE);
		cli->cl_default_mds_cookiesize = def_cookiesize;
	}
}

+7 −39
Original line number Diff line number Diff line
@@ -204,7 +204,6 @@ enum obd_cl_sem_lock_class {
 * on the MDS.
 */
#define OBD_MAX_DEFAULT_EA_SIZE		4096
#define OBD_MAX_DEFAULT_COOKIE_SIZE	4096

struct mdc_rpc_lock;
struct obd_import;
@@ -214,7 +213,7 @@ struct client_obd {
	struct obd_import       *cl_import; /* ptlrpc connection state */
	size_t			 cl_conn_count;
	/*
	 * Cache maximum and default values for easize and cookiesize. This is
	 * Cache maximum and default values for easize. This is
	 * strictly a performance optimization to minimize calls to
	 * obd_size_diskmd(). The default values are used to calculate the
	 * initial size of a request buffer. The ptlrpc layer will resize the
@@ -235,18 +234,6 @@ struct client_obd {
	 * run-time if a larger observed size is advertised by the MDT.
	 */
	u32			 cl_max_mds_easize;
	/* Default cookie size for llog cookies (see struct llog_cookie). It is
	 * initialized to zero at mount-time, then it tracks the largest
	 * observed cookie size advertised by the MDT, up to a maximum value of
	 * OBD_MAX_DEFAULT_COOKIE_SIZE. Note that llog_cookies are not
	 * used by clients communicating with MDS versions 2.4.0 and later.
	 */
	u32			 cl_default_mds_cookiesize;
	/* Maximum possible cookie size computed at mount-time based on
	 * the number of OSTs in the filesystem. May be increased at
	 * run-time if a larger observed size is advertised by the MDT.
	 */
	u32			 cl_max_mds_cookiesize;

	enum lustre_sec_part     cl_sp_me;
	enum lustre_sec_part     cl_sp_to;
@@ -447,8 +434,6 @@ struct lmv_obd {
	int			connected;
	int			max_easize;
	int			max_def_easize;
	int			max_cookiesize;
	int			max_def_cookiesize;

	u32			tgts_size; /* size of tgts array */
	struct lmv_tgt_desc	**tgts;
@@ -505,21 +490,6 @@ struct niobuf_local {
/* Don't conflict with on-wire flags OBD_BRW_WRITE, etc */
#define N_LOCAL_TEMP_PAGE 0x10000000

struct obd_trans_info {
	__u64		    oti_xid;
	/* Only used on the server side for tracking acks. */
	struct oti_req_ack_lock {
		struct lustre_handle lock;
		__u32		mode;
	}			oti_ack_locks[4];
	void		    *oti_handle;
	struct llog_cookie       oti_onecookie;
	struct llog_cookie      *oti_logcookies;

	/** VBR: versions */
	__u64		    oti_pre_version;
};

/*
 * Events signalled through obd_notify() upcall-chain.
 */
@@ -891,24 +861,22 @@ struct obd_ops {
			struct lov_stripe_md **mem_tgt,
			struct lov_mds_md *disk_src, int disk_len);
	int (*create)(const struct lu_env *env, struct obd_export *exp,
		      struct obdo *oa, struct obd_trans_info *oti);
		      struct obdo *oa);
	int (*destroy)(const struct lu_env *env, struct obd_export *exp,
		       struct obdo *oa, struct obd_trans_info *oti);
		       struct obdo *oa);
	int (*setattr)(const struct lu_env *, struct obd_export *exp,
		       struct obd_info *oinfo, struct obd_trans_info *oti);
		       struct obd_info *oinfo);
	int (*getattr)(const struct lu_env *env, struct obd_export *exp,
		       struct obd_info *oinfo);
	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,
		      int *nr_pages, struct niobuf_local *local,
		      struct obd_trans_info *oti);
		      int *nr_pages, struct niobuf_local *local);
	int (*commitrw)(const struct lu_env *env, int cmd,
			struct obd_export *exp, struct obdo *oa,
			int objcount, struct obd_ioobj *obj,
			struct niobuf_remote *remote, int pages,
			struct niobuf_local *local,
			struct obd_trans_info *oti, int rc);
			struct niobuf_local *local, int rc);
	int (*init_export)(struct obd_export *exp);
	int (*destroy_export)(struct obd_export *exp);

@@ -1018,7 +986,7 @@ struct md_ops {
			u64, const char *, const char *, int, int, int,
			struct ptlrpc_request **);

	int (*init_ea_size)(struct obd_export *, u32, u32, u32, u32);
	int (*init_ea_size)(struct obd_export *, u32, u32);

	int (*get_lustre_md)(struct obd_export *, struct ptlrpc_request *,
			     struct obd_export *, struct obd_export *,
+13 −18
Original line number Diff line number Diff line
@@ -686,26 +686,26 @@ static inline int obd_free_memmd(struct obd_export *exp,
}

static inline int obd_create(const struct lu_env *env, struct obd_export *exp,
			     struct obdo *obdo, struct obd_trans_info *oti)
			     struct obdo *obdo)
{
	int rc;

	EXP_CHECK_DT_OP(exp, create);
	EXP_COUNTER_INCREMENT(exp, create);

	rc = OBP(exp->exp_obd, create)(env, exp, obdo, oti);
	rc = OBP(exp->exp_obd, create)(env, exp, obdo);
	return rc;
}

static inline int obd_destroy(const struct lu_env *env, struct obd_export *exp,
			      struct obdo *obdo, struct obd_trans_info *oti)
			      struct obdo *obdo)
{
	int rc;

	EXP_CHECK_DT_OP(exp, destroy);
	EXP_COUNTER_INCREMENT(exp, destroy);

	rc = OBP(exp->exp_obd, destroy)(env, exp, obdo, oti);
	rc = OBP(exp->exp_obd, destroy)(env, exp, obdo);
	return rc;
}

@@ -722,15 +722,14 @@ static inline int obd_getattr(const struct lu_env *env, struct obd_export *exp,
}

static inline int obd_setattr(const struct lu_env *env, struct obd_export *exp,
			      struct obd_info *oinfo,
			      struct obd_trans_info *oti)
			      struct obd_info *oinfo)
{
	int rc;

	EXP_CHECK_DT_OP(exp, setattr);
	EXP_COUNTER_INCREMENT(exp, setattr);

	rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo, oti);
	rc = OBP(exp->exp_obd, setattr)(env, exp, oinfo);
	return rc;
}

@@ -1056,8 +1055,7 @@ static inline int obd_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, int *pages,
			     struct niobuf_local *local,
			     struct obd_trans_info *oti)
			     struct niobuf_local *local)
{
	int rc;

@@ -1065,7 +1063,7 @@ static inline int obd_preprw(const struct lu_env *env, int cmd,
	EXP_COUNTER_INCREMENT(exp, preprw);

	rc = OBP(exp->exp_obd, preprw)(env, cmd, exp, oa, objcount, obj, remote,
				       pages, local, oti);
				       pages, local);
	return rc;
}

@@ -1073,14 +1071,13 @@ static inline int obd_commitrw(const struct lu_env *env, int cmd,
			       struct obd_export *exp, struct obdo *oa,
			       int objcount, struct obd_ioobj *obj,
			       struct niobuf_remote *rnb, int pages,
			       struct niobuf_local *local,
			       struct obd_trans_info *oti, int rc)
			       struct niobuf_local *local, int rc)
{
	EXP_CHECK_DT_OP(exp, commitrw);
	EXP_COUNTER_INCREMENT(exp, commitrw);

	rc = OBP(exp->exp_obd, commitrw)(env, cmd, exp, oa, objcount, obj,
					 rnb, pages, local, oti, rc);
					 rnb, pages, local, rc);
	return rc;
}

@@ -1507,14 +1504,12 @@ static inline enum ldlm_mode md_lock_match(struct obd_export *exp, __u64 flags,
					     policy, mode, lockh);
}

static inline int md_init_ea_size(struct obd_export *exp, int easize,
				  int def_asize, int cookiesize,
				  int def_cookiesize)
static inline int md_init_ea_size(struct obd_export *exp, u32 easize,
				  u32 def_asize)
{
	EXP_CHECK_MD_OP(exp, init_ea_size);
	EXP_MD_COUNTER_INCREMENT(exp, init_ea_size);
	return MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize,
					       cookiesize, def_cookiesize);
	return MDP(exp->exp_obd, init_ea_size)(exp, easize, def_asize);
}

static inline int md_intent_getattr_async(struct obd_export *exp,
+1 −2
Original line number Diff line number Diff line
@@ -399,9 +399,8 @@ int client_obd_setup(struct obd_device *obddev, struct lustre_cfg *lcfg)
	}

	cli->cl_import = imp;
	/* cli->cl_max_mds_{easize,cookiesize} updated by mdc_init_ea_size() */
	/* cli->cl_max_mds_easize updated by mdc_init_ea_size() */
	cli->cl_max_mds_easize = sizeof(struct lov_mds_md_v3);
	cli->cl_max_mds_cookiesize = sizeof(struct llog_cookie);

	if (LUSTRE_CFG_BUFLEN(lcfg, 3) > 0) {
		if (!strcmp(lustre_cfg_string(lcfg, 3), "inactive")) {
Loading