Commit 394a9726 authored by Andreas Dilger's avatar Andreas Dilger Committed by Greg Kroah-Hartman

staging: lustre: ldlm: remove ldlm_wire_policy_data_t typedef usage from code

Replace usage of ldlm_wire_policy_data_t with named enums
to conform to upstream coding style.
Signed-off-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: http://review.whamcloud.com/15300
Reviewed-on: http://review.whamcloud.com/15301Reviewed-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Reviewed-by: default avatarBob Glossman <bob.glossman@intel.com>
Reviewed-by: default avatarfrank zago <fzago@cray.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: default avatarJohn L. Hammond <john.hammond@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 2885bdea
...@@ -2623,11 +2623,11 @@ struct ldlm_flock_wire { ...@@ -2623,11 +2623,11 @@ struct ldlm_flock_wire {
* on the resource type. * on the resource type.
*/ */
typedef union { union ldlm_wire_policy_data {
struct ldlm_extent l_extent; struct ldlm_extent l_extent;
struct ldlm_flock_wire l_flock; struct ldlm_flock_wire l_flock;
struct ldlm_inodebits l_inodebits; struct ldlm_inodebits l_inodebits;
} ldlm_wire_policy_data_t; };
union ldlm_gl_desc { union ldlm_gl_desc {
struct ldlm_gl_lquota_desc lquota_desc; struct ldlm_gl_lquota_desc lquota_desc;
...@@ -2669,7 +2669,7 @@ struct ldlm_lock_desc { ...@@ -2669,7 +2669,7 @@ struct ldlm_lock_desc {
struct ldlm_resource_desc l_resource; struct ldlm_resource_desc l_resource;
enum ldlm_mode l_req_mode; enum ldlm_mode l_req_mode;
enum ldlm_mode l_granted_mode; enum ldlm_mode l_granted_mode;
ldlm_wire_policy_data_t l_policy_data; union ldlm_wire_policy_data l_policy_data;
}; };
#define LDLM_LOCKREQ_HANDLES 2 #define LDLM_LOCKREQ_HANDLES 2
......
...@@ -560,7 +560,7 @@ union ldlm_policy_data { ...@@ -560,7 +560,7 @@ union ldlm_policy_data {
}; };
void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type, void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type,
const ldlm_wire_policy_data_t *wpolicy, const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy); union ldlm_policy_data *lpolicy);
enum lvb_type { enum lvb_type {
......
...@@ -240,7 +240,7 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock) ...@@ -240,7 +240,7 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock)
} }
} }
void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy) union ldlm_policy_data *lpolicy)
{ {
memset(lpolicy, 0, sizeof(*lpolicy)); memset(lpolicy, 0, sizeof(*lpolicy));
...@@ -250,7 +250,7 @@ void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, ...@@ -250,7 +250,7 @@ void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
} }
void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy) union ldlm_wire_policy_data *wpolicy)
{ {
memset(wpolicy, 0, sizeof(*wpolicy)); memset(wpolicy, 0, sizeof(*wpolicy));
wpolicy->l_extent.start = lpolicy->l_extent.start; wpolicy->l_extent.start = lpolicy->l_extent.start;
......
...@@ -612,7 +612,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data) ...@@ -612,7 +612,7 @@ ldlm_flock_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data)
} }
EXPORT_SYMBOL(ldlm_flock_completion_ast); EXPORT_SYMBOL(ldlm_flock_completion_ast);
void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_flock_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy) union ldlm_policy_data *lpolicy)
{ {
memset(lpolicy, 0, sizeof(*lpolicy)); memset(lpolicy, 0, sizeof(*lpolicy));
...@@ -623,7 +623,7 @@ void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, ...@@ -623,7 +623,7 @@ void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
} }
void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy) union ldlm_wire_policy_data *wpolicy)
{ {
memset(wpolicy, 0, sizeof(*wpolicy)); memset(wpolicy, 0, sizeof(*wpolicy));
wpolicy->l_flock.lfw_start = lpolicy->l_flock.start; wpolicy->l_flock.lfw_start = lpolicy->l_flock.start;
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
#include "../include/lustre_lib.h" #include "../include/lustre_lib.h"
#include "ldlm_internal.h" #include "ldlm_internal.h"
void ldlm_ibits_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy) union ldlm_policy_data *lpolicy)
{ {
memset(lpolicy, 0, sizeof(*lpolicy)); memset(lpolicy, 0, sizeof(*lpolicy));
...@@ -62,7 +62,7 @@ void ldlm_ibits_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, ...@@ -62,7 +62,7 @@ void ldlm_ibits_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
} }
void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy) union ldlm_wire_policy_data *wpolicy)
{ {
memset(wpolicy, 0, sizeof(*wpolicy)); memset(wpolicy, 0, sizeof(*wpolicy));
wpolicy->l_inodebits.bits = lpolicy->l_inodebits.bits; wpolicy->l_inodebits.bits = lpolicy->l_inodebits.bits;
......
...@@ -312,25 +312,25 @@ static inline int is_granted_or_cancelled(struct ldlm_lock *lock) ...@@ -312,25 +312,25 @@ static inline int is_granted_or_cancelled(struct ldlm_lock *lock)
return ret; return ret;
} }
typedef void (*ldlm_policy_wire_to_local_t)(const ldlm_wire_policy_data_t *, typedef void (*ldlm_policy_wire_to_local_t)(const union ldlm_wire_policy_data *,
union ldlm_policy_data *); union ldlm_policy_data *);
typedef void (*ldlm_policy_local_to_wire_t)(const union ldlm_policy_data *, typedef void (*ldlm_policy_local_to_wire_t)(const union ldlm_policy_data *,
ldlm_wire_policy_data_t *); union ldlm_wire_policy_data *);
void ldlm_plain_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_plain_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy); union ldlm_policy_data *lpolicy);
void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy); union ldlm_wire_policy_data *wpolicy);
void ldlm_ibits_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_ibits_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy); union ldlm_policy_data *lpolicy);
void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy); union ldlm_wire_policy_data *wpolicy);
void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_extent_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy); union ldlm_policy_data *lpolicy);
void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy); union ldlm_wire_policy_data *wpolicy);
void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_flock_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy); union ldlm_policy_data *lpolicy);
void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy); union ldlm_wire_policy_data *wpolicy);
...@@ -82,7 +82,7 @@ static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = { ...@@ -82,7 +82,7 @@ static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = {
*/ */
static void ldlm_convert_policy_to_wire(enum ldlm_type type, static void ldlm_convert_policy_to_wire(enum ldlm_type type,
const union ldlm_policy_data *lpolicy, const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy) union ldlm_wire_policy_data *wpolicy)
{ {
ldlm_policy_local_to_wire_t convert; ldlm_policy_local_to_wire_t convert;
...@@ -95,7 +95,7 @@ static void ldlm_convert_policy_to_wire(enum ldlm_type type, ...@@ -95,7 +95,7 @@ static void ldlm_convert_policy_to_wire(enum ldlm_type type,
* Converts lock policy from on the wire lock_desc format to local format * Converts lock policy from on the wire lock_desc format to local format
*/ */
void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type, void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type,
const ldlm_wire_policy_data_t *wpolicy, const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy) union ldlm_policy_data *lpolicy)
{ {
ldlm_policy_wire_to_local_t convert; ldlm_policy_wire_to_local_t convert;
......
...@@ -54,14 +54,14 @@ ...@@ -54,14 +54,14 @@
#include "ldlm_internal.h" #include "ldlm_internal.h"
void ldlm_plain_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy, void ldlm_plain_policy_wire_to_local(const union ldlm_wire_policy_data *wpolicy,
union ldlm_policy_data *lpolicy) union ldlm_policy_data *lpolicy)
{ {
/* No policy for plain locks */ /* No policy for plain locks */
} }
void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy, void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
ldlm_wire_policy_data_t *wpolicy) union ldlm_wire_policy_data *wpolicy)
{ {
/* No policy for plain locks */ /* No policy for plain locks */
} }
...@@ -2012,7 +2012,7 @@ static void lustre_swab_ldlm_res_id(struct ldlm_res_id *id) ...@@ -2012,7 +2012,7 @@ static void lustre_swab_ldlm_res_id(struct ldlm_res_id *id)
__swab64s(&id->name[i]); __swab64s(&id->name[i]);
} }
static void lustre_swab_ldlm_policy_data(ldlm_wire_policy_data_t *d) static void lustre_swab_ldlm_policy_data(union ldlm_wire_policy_data *d)
{ {
/* the lock data is a union and the first two fields are always an /* the lock data is a union and the first two fields are always an
* extent so it's ok to process an LDLM_EXTENT and LDLM_FLOCK lock * extent so it's ok to process an LDLM_EXTENT and LDLM_FLOCK lock
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment