From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org,
Andreas Dilger <andreas.dilger@intel.com>,
Oleg Drokin <oleg.drokin@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Lustre Development List <lustre-devel@lists.lustre.org>,
Ben Evans <bevans@cray.com>,
James Simmons <jsimmons@infradead.org>
Subject: [PATCH 01/64] staging: lustre: uapi: Move functions out of lustre_idl.h
Date: Mon, 14 Aug 2017 11:46:29 -0400 [thread overview]
Message-ID: <1502725652-26280-2-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1502725652-26280-1-git-send-email-jsimmons@infradead.org>
From: Ben Evans <bevans@cray.com>
Migrate functions set/get_mrc_cr_flags, ldlm_res_eq
ldlm_extent_overlap, ldlm_extent_contain,
ldlm_request_bufsize, and all the PTLRPC dump_*
functions out of lustre_idl.h which is a UAPI header
to the places in the kernel code they are actually used.
Delete unused lmv_mds_md_stripe_count and
agent_req_in_final_state.
Signed-off-by: Ben Evans <bevans@cray.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6401
Reviewed-on: http://review.whamcloud.com/21484
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
.../lustre/lustre/include/lustre/lustre_idl.h | 73 ----------------------
drivers/staging/lustre/lustre/include/lustre_dlm.h | 13 ++++
.../staging/lustre/lustre/include/lustre_swab.h | 6 ++
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h | 6 ++
drivers/staging/lustre/lustre/ldlm/ldlm_request.c | 27 ++++++++
drivers/staging/lustre/lustre/mdc/mdc_lib.c | 6 ++
6 files changed, 58 insertions(+), 73 deletions(-)
diff --git a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
index 1db1ab8..1e8ecdf 100644
--- a/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/lustre/include/lustre/lustre_idl.h
@@ -2130,17 +2130,6 @@ struct mdt_rec_create {
__u32 cr_padding_4; /* rr_padding_4 */
};
-static inline void set_mrc_cr_flags(struct mdt_rec_create *mrc, __u64 flags)
-{
- mrc->cr_flags_l = (__u32)(flags & 0xFFFFFFFFUll);
- mrc->cr_flags_h = (__u32)(flags >> 32);
-}
-
-static inline __u64 get_mrc_cr_flags(struct mdt_rec_create *mrc)
-{
- return ((__u64)(mrc->cr_flags_l) | ((__u64)mrc->cr_flags_h << 32));
-}
-
/* instance of mdt_reint_rec */
struct mdt_rec_link {
__u32 lk_opcode;
@@ -2403,25 +2392,6 @@ static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm)
}
}
-static inline int lmv_mds_md_stripe_count_set(union lmv_mds_md *lmm,
- unsigned int stripe_count)
-{
- int rc = 0;
-
- switch (le32_to_cpu(lmm->lmv_magic)) {
- case LMV_MAGIC_V1:
- lmm->lmv_md_v1.lmv_stripe_count = cpu_to_le32(stripe_count);
- break;
- case LMV_USER_MAGIC:
- lmm->lmv_user_md.lum_stripe_count = cpu_to_le32(stripe_count);
- break;
- default:
- rc = -EINVAL;
- break;
- }
- return rc;
-}
-
enum fld_rpc_opc {
FLD_QUERY = 900,
FLD_READ = 901,
@@ -2502,12 +2472,6 @@ struct ldlm_res_id {
#define PLDLMRES(res) (res)->lr_name.name[0], (res)->lr_name.name[1], \
(res)->lr_name.name[2], (res)->lr_name.name[3]
-static inline bool ldlm_res_eq(const struct ldlm_res_id *res0,
- const struct ldlm_res_id *res1)
-{
- return !memcmp(res0, res1, sizeof(*res0));
-}
-
/* lock types */
enum ldlm_mode {
LCK_MINMODE = 0,
@@ -2540,19 +2504,6 @@ struct ldlm_extent {
__u64 gid;
};
-static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1,
- const struct ldlm_extent *ex2)
-{
- return (ex1->start <= ex2->end) && (ex2->start <= ex1->end);
-}
-
-/* check if @ex1 contains @ex2 */
-static inline int ldlm_extent_contain(const struct ldlm_extent *ex1,
- const struct ldlm_extent *ex2)
-{
- return (ex1->start <= ex2->start) && (ex1->end >= ex2->end);
-}
-
struct ldlm_inodebits {
__u64 bits;
};
@@ -2627,18 +2578,6 @@ struct ldlm_request {
struct lustre_handle lock_handle[LDLM_LOCKREQ_HANDLES];
};
-/* If LDLM_ENQUEUE, 1 slot is already occupied, 1 is available.
- * Otherwise, 2 are available.
- */
-#define ldlm_request_bufsize(count, type) \
-({ \
- int _avail = LDLM_LOCKREQ_HANDLES; \
- _avail -= (type == LDLM_ENQUEUE ? LDLM_ENQUEUE_CANCEL_OFF : 0); \
- sizeof(struct ldlm_request) + \
- (count > _avail ? count - _avail : 0) * \
- sizeof(struct lustre_handle); \
-})
-
struct ldlm_reply {
__u32 lock_flags;
__u32 lock_padding; /* also fix lustre_swab_ldlm_reply */
@@ -2942,12 +2881,6 @@ static inline const char *agent_req_status2name(const enum agent_req_status ars)
}
}
-static inline bool agent_req_in_final_state(enum agent_req_status ars)
-{
- return ((ars == ARS_SUCCEED) || (ars == ARS_FAILED) ||
- (ars == ARS_CANCELED));
-}
-
struct llog_agent_req_rec {
struct llog_rec_hdr arr_hdr; /**< record header */
__u32 arr_status; /**< status of the request */
@@ -3142,12 +3075,6 @@ struct ll_fiemap_info_key {
struct fiemap lfik_fiemap;
};
-/* Functions for dumping PTLRPC fields */
-void dump_rniobuf(struct niobuf_remote *rnb);
-void dump_ioo(struct obd_ioobj *nb);
-void dump_ost_body(struct ost_body *ob);
-void dump_rcs(__u32 *rc);
-
/* security opcodes */
enum sec_cmd {
SEC_CTX_INIT = 801,
diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 1e86fb5..eb2de13 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -1336,5 +1336,18 @@ int ldlm_pool_init(struct ldlm_pool *pl, struct ldlm_namespace *ns,
void ldlm_pool_del(struct ldlm_pool *pl, struct ldlm_lock *lock);
/** @} */
+static inline int ldlm_extent_overlap(const struct ldlm_extent *ex1,
+ const struct ldlm_extent *ex2)
+{
+ return ex1->start <= ex2->end && ex2->start <= ex1->end;
+}
+
+/* check if @ex1 contains @ex2 */
+static inline int ldlm_extent_contain(const struct ldlm_extent *ex1,
+ const struct ldlm_extent *ex2)
+{
+ return ex1->start <= ex2->start && ex1->end >= ex2->end;
+}
+
#endif
/** @} LDLM */
diff --git a/drivers/staging/lustre/lustre/include/lustre_swab.h b/drivers/staging/lustre/lustre/include/lustre_swab.h
index 26d01c2..5c1bdc0 100644
--- a/drivers/staging/lustre/lustre/include/lustre_swab.h
+++ b/drivers/staging/lustre/lustre/include/lustre_swab.h
@@ -99,4 +99,10 @@ void lustre_swab_lov_user_md_objects(struct lov_user_ost_data *lod,
void lustre_swab_close_data(struct close_data *data);
void lustre_swab_lmv_user_md(struct lmv_user_md *lum);
+/* Functions for dumping PTLRPC fields */
+void dump_rniobuf(struct niobuf_remote *rnb);
+void dump_ioo(struct obd_ioobj *nb);
+void dump_ost_body(struct ost_body *ob);
+void dump_rcs(__u32 *rc);
+
#endif
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
index 2bf5c84..36808db 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
@@ -333,3 +333,9 @@ void ldlm_flock_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy);
void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
union ldlm_wire_policy_data *wpolicy);
+
+static inline bool ldlm_res_eq(const struct ldlm_res_id *res0,
+ const struct ldlm_res_id *res1)
+{
+ return memcmp(res0, res1, sizeof(*res0)) == 0;
+}
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
index 4028e11..2e3db5e 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_request.c
@@ -83,6 +83,33 @@ struct ldlm_async_args {
struct lustre_handle lock_handle;
};
+/**
+ * ldlm_request_bufsize
+ *
+ * @count: number of ldlm handles
+ * @type: ldlm opcode
+ *
+ * If opcode=LDLM_ENQUEUE, 1 slot is already occupied,
+ * LDLM_LOCKREQ_HANDLE -1 slots are available.
+ * Otherwise, LDLM_LOCKREQ_HANDLE slots are available.
+ *
+ * Return: size of the request buffer
+ */
+static int ldlm_request_bufsize(int count, int type)
+{
+ int avail = LDLM_LOCKREQ_HANDLES;
+
+ if (type == LDLM_ENQUEUE)
+ avail -= LDLM_ENQUEUE_CANCEL_OFF;
+
+ if (count > avail)
+ avail = (count - avail) * sizeof(struct lustre_handle);
+ else
+ avail = 0;
+
+ return sizeof(struct ldlm_request) + avail;
+}
+
static int ldlm_expired_completion_wait(void *data)
{
struct lock_wait_data *lwd = data;
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_lib.c b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
index b1853ff..aabdcec 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_lib.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_lib.c
@@ -35,6 +35,12 @@
#include "../include/lustre/lustre_idl.h"
#include "mdc_internal.h"
+static void set_mrc_cr_flags(struct mdt_rec_create *mrc, u64 flags)
+{
+ mrc->cr_flags_l = (u32)(flags & 0xFFFFFFFFUll);
+ mrc->cr_flags_h = (u32)(flags >> 32);
+}
+
static void __mdc_pack_body(struct mdt_body *b, __u32 suppgid)
{
b->mbo_suppgid = suppgid;
--
1.8.3.1
next prev parent reply other threads:[~2017-08-14 16:05 UTC|newest]
Thread overview: 66+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-14 15:46 [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers James Simmons
2017-08-14 15:46 ` James Simmons [this message]
2017-08-14 15:46 ` [PATCH 02/64] staging: lustre: uapi: remove unused functions for lustre_fid.h James Simmons
2017-08-14 15:46 ` [PATCH 03/64] staging: lustre: uapi: return error code for ostid_set_id James Simmons
2017-08-14 15:46 ` [PATCH 04/64] staging: lustre: uapi: update URL doc link in lustre_fid.h James Simmons
2017-08-14 15:46 ` [PATCH 05/64] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h James Simmons
2017-08-14 15:46 ` [PATCH 06/64] staging: lustre: uapi: remove unused function in lustre_disk.h James Simmons
2017-08-14 15:46 ` [PATCH 07/64] staging: lustre: uapi: remove userland version of obd_ioctl_*() James Simmons
2017-08-14 15:46 ` [PATCH 08/64] staging: lustre: uapi: remove obd_ioctl_freedata() wrapper James Simmons
2017-08-14 15:46 ` [PATCH 09/64] staging: lustre: uapi: remove obd_ioctl_popdata() wrapper James Simmons
2017-08-14 15:46 ` [PATCH 10/64] staging: lustre: uapi: move obd_ioctl_getdata() declaration James Simmons
2017-08-14 15:46 ` [PATCH 11/64] staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c James Simmons
2017-08-14 15:46 ` [PATCH 12/64] staging: lustre: uapi: move lustre_ioctl.h to uapi directory James Simmons
2017-08-14 15:46 ` [PATCH 13/64] staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h James Simmons
2017-08-14 15:46 ` [PATCH 14/64] staging: lustre: uapi: cleanup headers " James Simmons
2017-08-14 15:46 ` [PATCH 15/64] staging: lustre: uapi: label lustre_ioctl.h as a UAPI header James Simmons
2017-08-14 15:46 ` [PATCH 16/64] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h James Simmons
2017-08-14 15:46 ` [PATCH 17/64] staging: lustre: uapi: remove included headers " James Simmons
2017-08-14 15:46 ` [PATCH 18/64] staging: lustre: uapi: move lustre_param.h to uapi directory James Simmons
2017-08-14 15:46 ` [PATCH 19/64] staging: lustre: uapi: label lustre_param.h as an uapi header James Simmons
2017-08-14 15:46 ` [PATCH 20/64] staging: lustre: uapi: style cleanups for lustre_param.h James Simmons
2017-08-14 15:46 ` [PATCH 21/64] staging: lustre: uapi: remove lustre_cfg_free wrapper James Simmons
2017-08-14 15:46 ` [PATCH 22/64] staging: lustre: uapi: don't memory allocate in UAPI header James Simmons
2017-08-14 15:46 ` [PATCH 23/64] staging: lustre: uapi: move lustre_cfg_string() to obd_config.c James Simmons
2017-08-14 15:46 ` [PATCH 24/64] staging: lustre: obdclass: no need to check for kfree James Simmons
2017-08-14 15:46 ` [PATCH 25/64] staging: lustre: uapi: move lustre_cfg.h to uapi directory James Simmons
2017-08-14 15:46 ` [PATCH 26/64] staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h James Simmons
2017-08-14 15:46 ` [PATCH 27/64] staging: lustre: uapi: change variable type to match James Simmons
2017-08-14 15:46 ` [PATCH 28/64] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL James Simmons
2017-08-14 15:46 ` [PATCH 29/64] staging: lustre: uapi: style cleanup of lustre_cfg.h James Simmons
2017-08-14 15:46 ` [PATCH 30/64] staging: lustre: uapi: label lustre_cfg.h as an uapi header James Simmons
2017-08-14 15:46 ` [PATCH 31/64] staging: lustre: libcfs: remove htonl hack in libcfs.h James Simmons
2017-08-14 15:47 ` [PATCH 32/64] staging: lustre: libcfs: remove LOGL and LOGU macros James Simmons
2017-08-14 15:47 ` [PATCH 33/64] staging: lustre: libcfs: create libcfs_debug.h UAPI header James Simmons
2017-08-14 15:47 ` [PATCH 34/64] staging: lustre: socklnd: create socklnd.h " James Simmons
2017-08-14 15:47 ` [PATCH 35/64] staging: lustre: lnet: delete lnet.h James Simmons
2017-08-14 15:47 ` [PATCH 36/64] staging: lustre: lnet: migrate headers to lnet uapi directory James Simmons
2017-08-14 15:47 ` [PATCH 37/64] staging: lustre: libcfs: sort headers in libcfs.h James Simmons
2017-08-14 15:47 ` [PATCH 38/64] staging: lustre: lnet: remove userland function prototype in lnetctl.h James Simmons
2017-08-14 15:47 ` [PATCH 39/64] staging: lustre: lnet: remove BIT macro from lnetctl.h James Simmons
2017-08-14 15:47 ` [PATCH 40/64] staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h James Simmons
2017-08-14 15:47 ` [PATCH 41/64] staging: lustre: uapi: migrate remaining uapi headers to uapi directory James Simmons
2017-08-14 15:47 ` [PATCH 42/64] staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL James Simmons
2017-08-14 15:47 ` [PATCH 43/64] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h James Simmons
2017-08-14 15:47 ` [PATCH 44/64] staging: lustre: uapi: remove BIT macro from UAPI headers James Simmons
2017-08-14 15:47 ` [PATCH 45/64] staging: lustre: fid: add include path to Makefile James Simmons
2017-08-14 15:47 ` [PATCH 46/64] staging: lustre: fld: " James Simmons
2017-08-14 15:47 ` [PATCH 47/64] staging: lustre: ptlrpc: " James Simmons
2017-08-14 15:47 ` [PATCH 48/64] staging: lustre: llite: " James Simmons
2017-08-14 15:47 ` [PATCH 49/64] staging: lustre: lmv: " James Simmons
2017-08-14 15:47 ` [PATCH 50/64] staging: lustre: lov: " James Simmons
2017-08-14 15:47 ` [PATCH 51/64] staging: lustre: mdc: " James Simmons
2017-08-14 15:47 ` [PATCH 52/64] staging: lustre: mgc: " James Simmons
2017-08-14 15:47 ` [PATCH 53/64] staging: lustre: obdclass: " James Simmons
2017-08-14 15:47 ` [PATCH 54/64] staging: lustre: obdecho: " James Simmons
2017-08-14 15:47 ` [PATCH 55/64] staging: lustre: osc: " James Simmons
2017-08-14 15:47 ` [PATCH 56/64] staging: lustre: lustre: cleanup paths for lustre internal headers James Simmons
2017-08-14 15:47 ` [PATCH 57/64] staging: lustre: lustre: cleanup paths for lustre UAPI headers James Simmons
2017-08-14 15:47 ` [PATCH 58/64] staging: lustre: lnet: selftest: add include path to Makefile James Simmons
2017-08-14 15:47 ` [PATCH 59/64] staging: lustre: lnet: " James Simmons
2017-08-14 15:47 ` [PATCH 60/64] staging: lustre: ko2iblnd: " James Simmons
2017-08-14 15:47 ` [PATCH 61/64] staging: lustre: ksocklnd: " James Simmons
2017-08-14 15:47 ` [PATCH 62/64] staging: lustre: libcfs: " James Simmons
2017-08-14 15:47 ` [PATCH 63/64] staging: lustre: libcfs: cleanup paths for libcfs headers James Simmons
2017-08-14 15:47 ` [PATCH 64/64] staging: lustre: lnet: cleanup paths for all LNet headers James Simmons
2017-08-17 16:22 ` [PATCH 00/64] staging: lustre: uapi: normalize the lustre headers Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1502725652-26280-2-git-send-email-jsimmons@infradead.org \
--to=jsimmons@infradead.org \
--cc=andreas.dilger@intel.com \
--cc=bevans@cray.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lustre-devel@lists.lustre.org \
--cc=oleg.drokin@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®