All of lore.kernel.org
 help / color / mirror / Atom feed
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>,
	James Simmons <jsimmons@infradead.org>,
	James Simmons <uja.ornl@yahoo.com>
Subject: [PATCH 43/64 v2] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h
Date: Sat, 19 Aug 2017 22:26:37 -0400	[thread overview]
Message-ID: <1503196018-24500-44-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org>

In order for lustre_idl.h to be usable for both user
land and kernel space it has to use the proper
byteorder functions.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/16916
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/include/uapi/linux/lustre/lustre_idl.h   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h
index b7c1a1e..9613f7c 100644
--- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h
@@ -67,6 +67,7 @@
 #ifndef _LUSTRE_IDL_H_
 #define _LUSTRE_IDL_H_
 
+#include <asm/byteorder.h>
 #include <linux/types.h>
 
 #include "../lnet/lnet-types.h"
@@ -389,7 +390,7 @@ enum lu_dirpage_flags {
 
 static inline struct lu_dirent *lu_dirent_start(struct lu_dirpage *dp)
 {
-	if (le32_to_cpu(dp->ldp_flags) & LDF_EMPTY)
+	if (__le32_to_cpu(dp->ldp_flags) & LDF_EMPTY)
 		return NULL;
 	else
 		return dp->ldp_entries;
@@ -399,8 +400,8 @@ static inline struct lu_dirent *lu_dirent_next(struct lu_dirent *ent)
 {
 	struct lu_dirent *next;
 
-	if (le16_to_cpu(ent->lde_reclen) != 0)
-		next = ((void *)ent) + le16_to_cpu(ent->lde_reclen);
+	if (__le16_to_cpu(ent->lde_reclen) != 0)
+		next = ((void *)ent) + __le16_to_cpu(ent->lde_reclen);
 	else
 		next = NULL;
 
@@ -1840,11 +1841,11 @@ static inline ssize_t lmv_mds_md_size(int stripe_count, unsigned int lmm_magic)
 
 static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm)
 {
-	switch (le32_to_cpu(lmm->lmv_magic)) {
+	switch (__le32_to_cpu(lmm->lmv_magic)) {
 	case LMV_MAGIC_V1:
-		return le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count);
+		return __le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count);
 	case LMV_USER_MAGIC:
-		return le32_to_cpu(lmm->lmv_user_md.lum_stripe_count);
+		return __le32_to_cpu(lmm->lmv_user_md.lum_stripe_count);
 	default:
 		return -EINVAL;
 	}
-- 
1.8.3.1

WARNING: multiple messages have this Message-ID (diff)
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>,
	James Simmons <jsimmons@infradead.org>,
	James Simmons <uja.ornl@yahoo.com>
Subject: [lustre-devel] [PATCH 43/64 v2] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h
Date: Sat, 19 Aug 2017 22:26:37 -0400	[thread overview]
Message-ID: <1503196018-24500-44-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1503196018-24500-1-git-send-email-jsimmons@infradead.org>

In order for lustre_idl.h to be usable for both user
land and kernel space it has to use the proper
byteorder functions.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6245
Reviewed-on: http://review.whamcloud.com/16916
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../staging/lustre/include/uapi/linux/lustre/lustre_idl.h   | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h
index b7c1a1e..9613f7c 100644
--- a/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h
+++ b/drivers/staging/lustre/include/uapi/linux/lustre/lustre_idl.h
@@ -67,6 +67,7 @@
 #ifndef _LUSTRE_IDL_H_
 #define _LUSTRE_IDL_H_
 
+#include <asm/byteorder.h>
 #include <linux/types.h>
 
 #include "../lnet/lnet-types.h"
@@ -389,7 +390,7 @@ enum lu_dirpage_flags {
 
 static inline struct lu_dirent *lu_dirent_start(struct lu_dirpage *dp)
 {
-	if (le32_to_cpu(dp->ldp_flags) & LDF_EMPTY)
+	if (__le32_to_cpu(dp->ldp_flags) & LDF_EMPTY)
 		return NULL;
 	else
 		return dp->ldp_entries;
@@ -399,8 +400,8 @@ static inline struct lu_dirent *lu_dirent_next(struct lu_dirent *ent)
 {
 	struct lu_dirent *next;
 
-	if (le16_to_cpu(ent->lde_reclen) != 0)
-		next = ((void *)ent) + le16_to_cpu(ent->lde_reclen);
+	if (__le16_to_cpu(ent->lde_reclen) != 0)
+		next = ((void *)ent) + __le16_to_cpu(ent->lde_reclen);
 	else
 		next = NULL;
 
@@ -1840,11 +1841,11 @@ static inline ssize_t lmv_mds_md_size(int stripe_count, unsigned int lmm_magic)
 
 static inline int lmv_mds_md_stripe_count_get(const union lmv_mds_md *lmm)
 {
-	switch (le32_to_cpu(lmm->lmv_magic)) {
+	switch (__le32_to_cpu(lmm->lmv_magic)) {
 	case LMV_MAGIC_V1:
-		return le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count);
+		return __le32_to_cpu(lmm->lmv_md_v1.lmv_stripe_count);
 	case LMV_USER_MAGIC:
-		return le32_to_cpu(lmm->lmv_user_md.lum_stripe_count);
+		return __le32_to_cpu(lmm->lmv_user_md.lum_stripe_count);
 	default:
 		return -EINVAL;
 	}
-- 
1.8.3.1

  parent reply	other threads:[~2017-08-20  2:27 UTC|newest]

Thread overview: 130+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-20  2:25 [PATCH 00/64 v2] staging: lustre: uapi: normalize the lustre headers James Simmons
2017-08-20  2:25 ` [lustre-devel] " James Simmons
2017-08-20  2:25 ` [PATCH 01/64 v2] staging: lustre: uapi: Move functions out of lustre_idl.h James Simmons
2017-08-20  2:25   ` [lustre-devel] " James Simmons
2017-08-20  2:25 ` [PATCH 02/64 v2] staging: lustre: uapi: remove unused functions for lustre_fid.h James Simmons
2017-08-20  2:25   ` [lustre-devel] " James Simmons
2017-08-20  2:25 ` [PATCH 03/64 v2] staging: lustre: uapi: return error code for ostid_set_id James Simmons
2017-08-20  2:25   ` [lustre-devel] " James Simmons
2017-08-20  2:25 ` [PATCH 04/64 v2] staging: lustre: uapi: update URL doc link in lustre_fid.h James Simmons
2017-08-20  2:25   ` [lustre-devel] " James Simmons
2017-08-20  2:25 ` [PATCH 05/64 v2] staging: lustre: uapi: move lu_fid, ost_id funcs out of lustre_idl.h James Simmons
2017-08-20  2:25   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 06/64 v2] staging: lustre: uapi: remove unused function in lustre_disk.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 07/64 v2] staging: lustre: uapi: remove userland version of obd_ioctl_*() James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 08/64 v2] staging: lustre: uapi: remove obd_ioctl_freedata() wrapper James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 09/64 v2] staging: lustre: uapi: remove obd_ioctl_popdata() wrapper James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 10/64 v2] staging: lustre: uapi: move obd_ioctl_getdata() declaration James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 11/64 v2] staging: lustre: uapi: move obd_ioctl_is_invalid() to linux-module.c James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 12/64 v2] staging: lustre: uapi: move lustre_ioctl.h to uapi directory James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 13/64 v2] staging: lustre: uapi: use __ALIGN_KERNEL for lustre_ioctl.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 14/64 v2] staging: lustre: uapi: cleanup headers " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 15/64 v2] staging: lustre: uapi: label lustre_ioctl.h as a UAPI header James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 16/64 v2] staging: lustre: uapi: move kernel only prototypes out of lustre_param.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 17/64 v2] staging: lustre: uapi: remove included headers " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 18/64 v2] staging: lustre: uapi: move lustre_param.h to uapi directory James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 19/64 v2] staging: lustre: uapi: label lustre_param.h as an uapi header James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 20/64 v2] staging: lustre: uapi: style cleanups for lustre_param.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 21/64 v2] staging: lustre: uapi: remove lustre_cfg_free wrapper James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 22/64 v2] staging: lustre: uapi: don't memory allocate in UAPI header James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 23/64 v2] staging: lustre: uapi: move lustre_cfg_string() to obd_config.c James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 24/64 v2] staging: lustre: obdclass: no need to check for kfree James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 25/64 v2] staging: lustre: uapi: move lustre_cfg.h to uapi directory James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 26/64 v2] staging: lustre: uapi: remove need for libcfs.h from lustre_cfg.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 27/64 v2] staging: lustre: uapi: change variable type to match James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 28/64 v2] staging: lustre: uapi: check if argument for lustre_cfg_buf() is NULL James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 29/64 v2] staging: lustre: uapi: style cleanup of lustre_cfg.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 30/64 v2] staging: lustre: uapi: label lustre_cfg.h as an uapi header James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 31/64 v2] staging: lustre: libcfs: remove htonl hack in libcfs.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 32/64 v2] staging: lustre: libcfs: remove LOGL and LOGU macros James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 33/64 v2] staging: lustre: libcfs: create libcfs_debug.h UAPI header James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 34/64 v2] staging: lustre: socklnd: create socklnd.h " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 35/64 v2] staging: lustre: lnet: delete lnet.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 36/64 v2] staging: lustre: lnet: migrate headers to lnet uapi directory James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 37/64 v2] staging: lustre: libcfs: sort headers in libcfs.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 38/64 v2] staging: lustre: lnet: remove userland function prototype in lnetctl.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 39/64 v2] staging: lustre: lnet: remove BIT macro from lnetctl.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 40/64 v2] staging: lustre: uapi: remove libcfs.h from lustre_id.h/lustre_user.h James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 41/64 v2] staging: lustre: uapi: migrate remaining uapi headers to uapi directory James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 42/64 v2] staging: lustre: uapi: remove CONFIG_LUSTRE_OBD_MAX_IOCTL James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` James Simmons [this message]
2017-08-20  2:26   ` [lustre-devel] [PATCH 43/64 v2] staging: lustre: uapi: use proper byteorder functions in lustre_idl.h James Simmons
2017-08-20  2:26 ` [PATCH 44/64 v2] staging: lustre: uapi: remove BIT macro from UAPI headers James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 45/64 v2] staging: lustre: fid: add include path to Makefile James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 46/64 v2] staging: lustre: fld: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 47/64 v2] staging: lustre: ptlrpc: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 48/64 v2] staging: lustre: llite: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 49/64 v2] staging: lustre: lmv: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 50/64 v2] staging: lustre: lov: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 51/64 v2] staging: lustre: mdc: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 52/64 v2] staging: lustre: mgc: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 53/64 v2] staging: lustre: obdclass: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 54/64 v2] staging: lustre: obdecho: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 55/64 v2] staging: lustre: osc: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 56/64 v2] staging: lustre: lustre: cleanup paths for lustre internal headers James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 57/64 v2] staging: lustre: lustre: cleanup paths for lustre UAPI headers James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 58/64 v2] staging: lustre: lnet: selftest: add include path to Makefile James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 59/64 v2] staging: lustre: lnet: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 60/64 v2] staging: lustre: ko2iblnd: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 61/64 v2] staging: lustre: ksocklnd: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 62/64 v2] staging: lustre: libcfs: " James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 63/64 v2] staging: lustre: libcfs: cleanup paths for libcfs headers James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons
2017-08-20  2:26 ` [PATCH 64/64 v2] staging: lustre: lnet: cleanup paths for all LNet headers James Simmons
2017-08-20  2:26   ` [lustre-devel] " James Simmons

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=1503196018-24500-44-git-send-email-jsimmons@infradead.org \
    --to=jsimmons@infradead.org \
    --cc=andreas.dilger@intel.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 \
    --cc=uja.ornl@yahoo.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.