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

Commit f3478e02 authored by Oleg Drokin's avatar Oleg Drokin Committed by Greg Kroah-Hartman
Browse files

staging/lustre: Get rid of object update code



Object update was originally planned to be used for cross-server
updates, so nothign to do with the client. The idea was
later significantly reworked anyway so even wire structs should
not be retained.

This gets rid of update_cmd_t, UPDATE and UPDATE_REPLY rpc and
corresponding subcommands, swabbig logic and such.

Signed-off-by: default avatarOleg Drokin <green@linuxhacker.ru>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9e04cbfc
Loading
Loading
Loading
Loading
+1 −15
Original line number Original line Diff line number Diff line
@@ -284,19 +284,6 @@ static inline int opcode_offset(__u32 opc)
			OPC_RANGE(LDLM) +
			OPC_RANGE(LDLM) +
			OPC_RANGE(MDS) +
			OPC_RANGE(MDS) +
			OPC_RANGE(OST));
			OPC_RANGE(OST));
	} else if (opc < UPDATE_LAST_OPC) {
		/* update opcode */
		return (opc - UPDATE_FIRST_OPC +
			OPC_RANGE(FLD) +
			OPC_RANGE(SEC) +
			OPC_RANGE(SEQ) +
			OPC_RANGE(QUOTA) +
			OPC_RANGE(LLOG) +
			OPC_RANGE(OBD) +
			OPC_RANGE(MGS) +
			OPC_RANGE(LDLM) +
			OPC_RANGE(MDS) +
			OPC_RANGE(OST));
	} else {
	} else {
		/* Unknown Opcode */
		/* Unknown Opcode */
		return -1;
		return -1;
@@ -312,8 +299,7 @@ static inline int opcode_offset(__u32 opc)
			    OPC_RANGE(SEC)  + \
			    OPC_RANGE(SEC)  + \
			    OPC_RANGE(SEQ)  + \
			    OPC_RANGE(SEQ)  + \
			    OPC_RANGE(SEC)  + \
			    OPC_RANGE(SEC)  + \
			    OPC_RANGE(FLD)  + \
			    OPC_RANGE(FLD))
			    OPC_RANGE(UPDATE))


#define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
#define EXTRA_MAX_OPCODES ((PTLRPC_LAST_CNTR - PTLRPC_FIRST_CNTR)  + \
			    OPC_RANGE(EXTRA))
			    OPC_RANGE(EXTRA))
+0 −94
Original line number Original line Diff line number Diff line
@@ -2053,14 +2053,6 @@ enum mds_cmd {


#define MDS_FIRST_OPC    MDS_GETATTR
#define MDS_FIRST_OPC    MDS_GETATTR


/* opcodes for object update */
typedef enum {
	UPDATE_OBJ	= 1000,
	UPDATE_LAST_OPC
} update_cmd_t;

#define UPDATE_FIRST_OPC    UPDATE_OBJ

/*
/*
 * Do not exceed 63
 * Do not exceed 63
 */
 */
@@ -3576,92 +3568,6 @@ void lustre_swab_hsm_user_state(struct hsm_user_state *hus);
void lustre_swab_hsm_user_item(struct hsm_user_item *hui);
void lustre_swab_hsm_user_item(struct hsm_user_item *hui);
void lustre_swab_hsm_request(struct hsm_request *hr);
void lustre_swab_hsm_request(struct hsm_request *hr);


/**
 * These are object update opcode under UPDATE_OBJ, which is currently
 * being used by cross-ref operations between MDT.
 *
 * During the cross-ref operation, the Master MDT, which the client send the
 * request to, will disassembly the operation into object updates, then OSP
 * will send these updates to the remote MDT to be executed.
 *
 *   Update request format
 *   magic:  UPDATE_BUFFER_MAGIC_V1
 *   Count:  How many updates in the req.
 *   bufs[0] : following are packets of object.
 *   update[0]:
 *		type: object_update_op, the op code of update
 *		fid: The object fid of the update.
 *		lens/bufs: other parameters of the update.
 *   update[1]:
 *		type: object_update_op, the op code of update
 *		fid: The object fid of the update.
 *		lens/bufs: other parameters of the update.
 *   ..........
 *   update[7]:	type: object_update_op, the op code of update
 *		fid: The object fid of the update.
 *		lens/bufs: other parameters of the update.
 *   Current 8 maxim updates per object update request.
 *
 *******************************************************************
 *   update reply format:
 *
 *   ur_version: UPDATE_REPLY_V1
 *   ur_count:   The count of the reply, which is usually equal
 *		 to the number of updates in the request.
 *   ur_lens:    The reply lengths of each object update.
 *
 *   replies:    1st update reply  [4bytes_ret: other body]
 *		 2nd update reply  [4bytes_ret: other body]
 *		 .....
 *		 nth update reply  [4bytes_ret: other body]
 *
 *   For each reply of the update, the format would be
 *	 result(4 bytes):Other stuff
 */

#define UPDATE_MAX_OPS		10
#define UPDATE_BUFFER_MAGIC_V1	0xBDDE0001
#define UPDATE_BUFFER_MAGIC	UPDATE_BUFFER_MAGIC_V1
#define UPDATE_BUF_COUNT	8
enum object_update_op {
	OBJ_CREATE		= 1,
	OBJ_DESTROY		= 2,
	OBJ_REF_ADD		= 3,
	OBJ_REF_DEL		= 4,
	OBJ_ATTR_SET		= 5,
	OBJ_ATTR_GET		= 6,
	OBJ_XATTR_SET		= 7,
	OBJ_XATTR_GET		= 8,
	OBJ_INDEX_LOOKUP	= 9,
	OBJ_INDEX_INSERT	= 10,
	OBJ_INDEX_DELETE	= 11,
	OBJ_LAST
};

struct update {
	__u32		u_type;
	__u32		u_batchid;
	struct lu_fid	u_fid;
	__u32		u_lens[UPDATE_BUF_COUNT];
	__u32		u_bufs[0];
};

struct update_buf {
	__u32	ub_magic;
	__u32	ub_count;
	__u32	ub_bufs[0];
};

#define UPDATE_REPLY_V1		0x00BD0001
struct update_reply {
	__u32	ur_version;
	__u32	ur_count;
	__u32	ur_lens[0];
};

void lustre_swab_update_buf(struct update_buf *ub);
void lustre_swab_update_reply_buf(struct update_reply *ur);

/** layout swap request structure
/** layout swap request structure
 * fid1 and fid2 are in mdt_body
 * fid1 and fid2 are in mdt_body
 */
 */
+0 −4
Original line number Original line Diff line number Diff line
@@ -146,7 +146,6 @@ extern struct req_format RQF_MDS_GETSTATUS;
extern struct req_format RQF_MDS_SYNC;
extern struct req_format RQF_MDS_SYNC;
extern struct req_format RQF_MDS_GETXATTR;
extern struct req_format RQF_MDS_GETXATTR;
extern struct req_format RQF_MDS_GETATTR;
extern struct req_format RQF_MDS_GETATTR;
extern struct req_format RQF_UPDATE_OBJ;


/*
/*
 * This is format of direct (non-intent) MDS_GETATTR_NAME request.
 * This is format of direct (non-intent) MDS_GETATTR_NAME request.
@@ -322,9 +321,6 @@ extern struct req_msg_field RMF_MGS_CONFIG_RES;
/* generic uint32 */
/* generic uint32 */
extern struct req_msg_field RMF_U32;
extern struct req_msg_field RMF_U32;


/* OBJ update format */
extern struct req_msg_field RMF_UPDATE;
extern struct req_msg_field RMF_UPDATE_REPLY;
/** @} req_layout */
/** @} req_layout */


#endif /* _LUSTRE_REQ_LAYOUT_H__ */
#endif /* _LUSTRE_REQ_LAYOUT_H__ */
+0 −25
Original line number Original line Diff line number Diff line
@@ -514,16 +514,6 @@ static const struct req_msg_field *mds_setattr_server[] = {
	&RMF_CAPA2
	&RMF_CAPA2
};
};


static const struct req_msg_field *mds_update_client[] = {
	&RMF_PTLRPC_BODY,
	&RMF_UPDATE,
};

static const struct req_msg_field *mds_update_server[] = {
	&RMF_PTLRPC_BODY,
	&RMF_UPDATE_REPLY,
};

static const struct req_msg_field *llog_origin_handle_create_client[] = {
static const struct req_msg_field *llog_origin_handle_create_client[] = {
	&RMF_PTLRPC_BODY,
	&RMF_PTLRPC_BODY,
	&RMF_LLOGD_BODY,
	&RMF_LLOGD_BODY,
@@ -721,7 +711,6 @@ static struct req_format *req_formats[] = {
	&RQF_MDS_HSM_ACTION,
	&RQF_MDS_HSM_ACTION,
	&RQF_MDS_HSM_REQUEST,
	&RQF_MDS_HSM_REQUEST,
	&RQF_MDS_SWAP_LAYOUTS,
	&RQF_MDS_SWAP_LAYOUTS,
	&RQF_UPDATE_OBJ,
	&RQF_QC_CALLBACK,
	&RQF_QC_CALLBACK,
	&RQF_OST_CONNECT,
	&RQF_OST_CONNECT,
	&RQF_OST_DISCONNECT,
	&RQF_OST_DISCONNECT,
@@ -1145,15 +1134,6 @@ struct req_msg_field RMF_MDS_HSM_REQUEST =
		    lustre_swab_hsm_request, NULL);
		    lustre_swab_hsm_request, NULL);
EXPORT_SYMBOL(RMF_MDS_HSM_REQUEST);
EXPORT_SYMBOL(RMF_MDS_HSM_REQUEST);


struct req_msg_field RMF_UPDATE = DEFINE_MSGF("update", 0, -1,
					      lustre_swab_update_buf, NULL);
EXPORT_SYMBOL(RMF_UPDATE);

struct req_msg_field RMF_UPDATE_REPLY = DEFINE_MSGF("update_reply", 0, -1,
						lustre_swab_update_reply_buf,
						    NULL);
EXPORT_SYMBOL(RMF_UPDATE_REPLY);

struct req_msg_field RMF_SWAP_LAYOUTS =
struct req_msg_field RMF_SWAP_LAYOUTS =
	DEFINE_MSGF("swap_layouts", 0, sizeof(struct  mdc_swap_layouts),
	DEFINE_MSGF("swap_layouts", 0, sizeof(struct  mdc_swap_layouts),
		    lustre_swab_swap_layouts, NULL);
		    lustre_swab_swap_layouts, NULL);
@@ -1357,11 +1337,6 @@ struct req_format RQF_MDS_GET_INFO =
			mds_getinfo_server);
			mds_getinfo_server);
EXPORT_SYMBOL(RQF_MDS_GET_INFO);
EXPORT_SYMBOL(RQF_MDS_GET_INFO);


struct req_format RQF_UPDATE_OBJ =
	DEFINE_REQ_FMT0("OBJECT_UPDATE_OBJ", mds_update_client,
			mds_update_server);
EXPORT_SYMBOL(RQF_UPDATE_OBJ);

struct req_format RQF_LDLM_ENQUEUE =
struct req_format RQF_LDLM_ENQUEUE =
	DEFINE_REQ_FMT0("LDLM_ENQUEUE",
	DEFINE_REQ_FMT0("LDLM_ENQUEUE",
			ldlm_enqueue_client, ldlm_enqueue_lvb_server);
			ldlm_enqueue_client, ldlm_enqueue_lvb_server);
+0 −1
Original line number Original line Diff line number Diff line
@@ -131,7 +131,6 @@ static struct ll_rpc_opcode {
	{ SEC_CTX_INIT_CONT, "sec_ctx_init_cont" },
	{ SEC_CTX_INIT_CONT, "sec_ctx_init_cont" },
	{ SEC_CTX_FINI,     "sec_ctx_fini" },
	{ SEC_CTX_FINI,     "sec_ctx_fini" },
	{ FLD_QUERY,	"fld_query" },
	{ FLD_QUERY,	"fld_query" },
	{ UPDATE_OBJ,	    "update_obj" },
};
};


static struct ll_eopcode {
static struct ll_eopcode {
Loading