staging: lustre: ldlm: remove ldlm_policy_data_t typedef usage from code
authorAndreas Dilger <andreas.dilger@intel.com>
Wed, 23 Nov 2016 22:59:47 +0000 (17:59 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2016 20:45:15 +0000 (21:45 +0100)
Replace usage of ldlm_policy_data_t with named enums
to conform to upstream coding style.

Signed-off-by: Andreas 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/15301
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: frank zago <fzago@cray.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25 files changed:
drivers/staging/lustre/lustre/include/lustre_dlm.h
drivers/staging/lustre/lustre/include/obd.h
drivers/staging/lustre/lustre/include/obd_class.h
drivers/staging/lustre/lustre/ldlm/ldlm_extent.c
drivers/staging/lustre/lustre/ldlm/ldlm_flock.c
drivers/staging/lustre/lustre/ldlm/ldlm_inodebits.c
drivers/staging/lustre/lustre/ldlm/ldlm_internal.h
drivers/staging/lustre/lustre/ldlm/ldlm_lock.c
drivers/staging/lustre/lustre/ldlm/ldlm_plain.c
drivers/staging/lustre/lustre/ldlm/ldlm_request.c
drivers/staging/lustre/lustre/llite/file.c
drivers/staging/lustre/lustre/llite/llite_internal.h
drivers/staging/lustre/lustre/llite/llite_mmap.c
drivers/staging/lustre/lustre/llite/vvp_io.c
drivers/staging/lustre/lustre/lmv/lmv_obd.c
drivers/staging/lustre/lustre/mdc/mdc_internal.h
drivers/staging/lustre/lustre/mdc/mdc_locks.c
drivers/staging/lustre/lustre/mdc/mdc_reint.c
drivers/staging/lustre/lustre/mgc/mgc_request.c
drivers/staging/lustre/lustre/osc/osc_cl_internal.h
drivers/staging/lustre/lustre/osc/osc_internal.h
drivers/staging/lustre/lustre/osc/osc_lock.c
drivers/staging/lustre/lustre/osc/osc_object.c
drivers/staging/lustre/lustre/osc/osc_page.c
drivers/staging/lustre/lustre/osc/osc_request.c

index d94237d97a554b78f0527306d583e3a5de5325e9..02921bf193e8741c9b144092fbea440224c7433e 100644 (file)
@@ -553,15 +553,15 @@ struct ldlm_flock {
        __u32 pid;
 };
 
-typedef union {
+union ldlm_policy_data {
        struct ldlm_extent l_extent;
        struct ldlm_flock l_flock;
        struct ldlm_inodebits l_inodebits;
-} ldlm_policy_data_t;
+};
 
 void ldlm_convert_policy_to_local(struct obd_export *exp, enum ldlm_type type,
                                  const ldlm_wire_policy_data_t *wpolicy,
-                                 ldlm_policy_data_t *lpolicy);
+                                 union ldlm_policy_data *lpolicy);
 
 enum lvb_type {
        LVB_T_NONE      = 0,
@@ -690,7 +690,7 @@ struct ldlm_lock {
         * Representation of private data specific for a lock type.
         * Examples are: extent range for extent lock or bitmask for ibits locks
         */
-       ldlm_policy_data_t      l_policy_data;
+       union ldlm_policy_data  l_policy_data;
 
        /**
         * Lock state flags. Protected by lr_lock.
@@ -1175,7 +1175,7 @@ void ldlm_lock_allow_match(struct ldlm_lock *lock);
 void ldlm_lock_allow_match_locked(struct ldlm_lock *lock);
 enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
                               const struct ldlm_res_id *,
-                              enum ldlm_type type, ldlm_policy_data_t *,
+                              enum ldlm_type type, union ldlm_policy_data *,
                               enum ldlm_mode mode, struct lustre_handle *,
                               int unref);
 enum ldlm_mode ldlm_revalidate_lock_handle(const struct lustre_handle *lockh,
@@ -1239,7 +1239,7 @@ int ldlm_completion_ast(struct ldlm_lock *lock, __u64 flags, void *data);
 int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
                     struct ldlm_enqueue_info *einfo,
                     const struct ldlm_res_id *res_id,
-                    ldlm_policy_data_t const *policy, __u64 *flags,
+                    union ldlm_policy_data const *policy, __u64 *flags,
                     void *lvb, __u32 lvb_len, enum lvb_type lvb_type,
                     struct lustre_handle *lockh, int async);
 int ldlm_prep_enqueue_req(struct obd_export *exp,
@@ -1263,13 +1263,13 @@ int ldlm_cli_cancel_unused(struct ldlm_namespace *, const struct ldlm_res_id *,
                           enum ldlm_cancel_flags flags, void *opaque);
 int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
                                    const struct ldlm_res_id *res_id,
-                                   ldlm_policy_data_t *policy,
+                                   union ldlm_policy_data *policy,
                                    enum ldlm_mode mode,
                                    enum ldlm_cancel_flags flags,
                                    void *opaque);
 int ldlm_cancel_resource_local(struct ldlm_resource *res,
                               struct list_head *cancels,
-                              ldlm_policy_data_t *policy,
+                              union ldlm_policy_data *policy,
                               enum ldlm_mode mode, __u64 lock_flags,
                               enum ldlm_cancel_flags cancel_flags,
                               void *opaque);
index 60efaaa726b1fe8c2bb8bf00aa3614ecfa76cc4d..d4d2ffa8cfdfc740ab93bef4b9d423a605d9a731 100644 (file)
@@ -879,7 +879,7 @@ struct md_ops {
                      const void *, size_t, umode_t, uid_t, gid_t,
                      cfs_cap_t, __u64, struct ptlrpc_request **);
        int (*enqueue)(struct obd_export *, struct ldlm_enqueue_info *,
-                      const ldlm_policy_data_t *,
+                      const union ldlm_policy_data *,
                       struct lookup_intent *, struct md_op_data *,
                       struct lustre_handle *, __u64);
        int (*getattr)(struct obd_export *, struct md_op_data *,
@@ -935,11 +935,11 @@ struct md_ops {
 
        enum ldlm_mode (*lock_match)(struct obd_export *, __u64,
                                     const struct lu_fid *, enum ldlm_type,
-                                    ldlm_policy_data_t *, enum ldlm_mode,
+                                    union ldlm_policy_data *, enum ldlm_mode,
                                     struct lustre_handle *);
 
        int (*cancel_unused)(struct obd_export *, const struct lu_fid *,
-                            ldlm_policy_data_t *, enum ldlm_mode,
+                            union ldlm_policy_data *, enum ldlm_mode,
                             enum ldlm_cancel_flags flags, void *opaque);
 
        int (*get_fid_from_lsm)(struct obd_export *,
index 9099b513f0362b55b4f1ad70b3a49b1cca46f93a..7ec25202cd2238f6d36537ba17a48621d7ac6573 100644 (file)
@@ -1208,7 +1208,7 @@ static inline int md_create(struct obd_export *exp, struct md_op_data *op_data,
 
 static inline int md_enqueue(struct obd_export *exp,
                             struct ldlm_enqueue_info *einfo,
-                            const ldlm_policy_data_t *policy,
+                            const union ldlm_policy_data *policy,
                             struct lookup_intent *it,
                             struct md_op_data *op_data,
                             struct lustre_handle *lockh,
@@ -1407,7 +1407,7 @@ static inline int md_set_lock_data(struct obd_export *exp,
 
 static inline int md_cancel_unused(struct obd_export *exp,
                                   const struct lu_fid *fid,
-                                  ldlm_policy_data_t *policy,
+                                  union ldlm_policy_data *policy,
                                   enum ldlm_mode mode,
                                   enum ldlm_cancel_flags flags,
                                   void *opaque)
@@ -1425,7 +1425,7 @@ static inline int md_cancel_unused(struct obd_export *exp,
 static inline enum ldlm_mode md_lock_match(struct obd_export *exp, __u64 flags,
                                           const struct lu_fid *fid,
                                           enum ldlm_type type,
-                                          ldlm_policy_data_t *policy,
+                                          union ldlm_policy_data *policy,
                                           enum ldlm_mode mode,
                                           struct lustre_handle *lockh)
 {
index a7b34e46fc1379a7dcad6eaa0bc129f297f8b77c..78cd70d2f53648a49190aa2ad5d26b3ff9786a93 100644 (file)
@@ -241,7 +241,7 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock)
 }
 
 void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                     ldlm_policy_data_t *lpolicy)
+                                     union ldlm_policy_data *lpolicy)
 {
        memset(lpolicy, 0, sizeof(*lpolicy));
        lpolicy->l_extent.start = wpolicy->l_extent.start;
@@ -249,7 +249,7 @@ void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
        lpolicy->l_extent.gid = wpolicy->l_extent.gid;
 }
 
-void ldlm_extent_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                      ldlm_wire_policy_data_t *wpolicy)
 {
        memset(wpolicy, 0, sizeof(*wpolicy));
index 98838e7b4e798ee9fbc2c492cbf3ca40eb927eb5..2683a7b52fd4d2fb9b997f2143157c1ae4732481 100644 (file)
@@ -613,7 +613,7 @@ granted:
 EXPORT_SYMBOL(ldlm_flock_completion_ast);
 
 void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                    ldlm_policy_data_t *lpolicy)
+                                    union ldlm_policy_data *lpolicy)
 {
        memset(lpolicy, 0, sizeof(*lpolicy));
        lpolicy->l_flock.start = wpolicy->l_flock.lfw_start;
@@ -622,7 +622,7 @@ void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
        lpolicy->l_flock.owner = wpolicy->l_flock.lfw_owner;
 }
 
-void ldlm_flock_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                     ldlm_wire_policy_data_t *wpolicy)
 {
        memset(wpolicy, 0, sizeof(*wpolicy));
index 79f4e6fa193e1d0b1d34b9953a52d16276ec52f2..11b45aebe57c356f91965ebbb8dd2f660a65081b 100644 (file)
 #include "ldlm_internal.h"
 
 void ldlm_ibits_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                    ldlm_policy_data_t *lpolicy)
+                                    union ldlm_policy_data *lpolicy)
 {
        memset(lpolicy, 0, sizeof(*lpolicy));
        lpolicy->l_inodebits.bits = wpolicy->l_inodebits.bits;
 }
 
-void ldlm_ibits_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                     ldlm_wire_policy_data_t *wpolicy)
 {
        memset(wpolicy, 0, sizeof(*wpolicy));
index 0099ff376ad9a3676a94bc81eb5ed3b06afcd581..1a98a315d8702d3faff17155fca4b2f6e4b67581 100644 (file)
@@ -312,24 +312,24 @@ static inline int is_granted_or_cancelled(struct ldlm_lock *lock)
 }
 
 typedef void (*ldlm_policy_wire_to_local_t)(const ldlm_wire_policy_data_t *,
-                                           ldlm_policy_data_t *);
+                                           union ldlm_policy_data *);
 
-typedef void (*ldlm_policy_local_to_wire_t)(const ldlm_policy_data_t *,
+typedef void (*ldlm_policy_local_to_wire_t)(const union ldlm_policy_data *,
                                            ldlm_wire_policy_data_t *);
 
 void ldlm_plain_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                    ldlm_policy_data_t *lpolicy);
-void ldlm_plain_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+                                    union ldlm_policy_data *lpolicy);
+void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                     ldlm_wire_policy_data_t *wpolicy);
 void ldlm_ibits_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                    ldlm_policy_data_t *lpolicy);
-void ldlm_ibits_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+                                    union ldlm_policy_data *lpolicy);
+void ldlm_ibits_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                     ldlm_wire_policy_data_t *wpolicy);
 void ldlm_extent_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                     ldlm_policy_data_t *lpolicy);
-void ldlm_extent_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+                                     union ldlm_policy_data *lpolicy);
+void ldlm_extent_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                      ldlm_wire_policy_data_t *wpolicy);
 void ldlm_flock_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                    ldlm_policy_data_t *lpolicy);
-void ldlm_flock_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+                                    union ldlm_policy_data *lpolicy);
+void ldlm_flock_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                     ldlm_wire_policy_data_t *wpolicy);
index 17d532e89c9a0ec684c3fc32fb39199a3f55d74a..3dc0a06bb58fc0beea63b189b4f1a5125c08c99b 100644 (file)
@@ -81,7 +81,7 @@ static ldlm_policy_local_to_wire_t ldlm_policy_local_to_wire[] = {
  * Converts lock policy from local format to on the wire lock_desc format
  */
 static void ldlm_convert_policy_to_wire(enum ldlm_type type,
-                                       const ldlm_policy_data_t *lpolicy,
+                                       const union ldlm_policy_data *lpolicy,
                                        ldlm_wire_policy_data_t *wpolicy)
 {
        ldlm_policy_local_to_wire_t convert;
@@ -96,7 +96,7 @@ static void ldlm_convert_policy_to_wire(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,
-                                 ldlm_policy_data_t *lpolicy)
+                                 union ldlm_policy_data *lpolicy)
 {
        ldlm_policy_wire_to_local_t convert;
 
@@ -1049,7 +1049,7 @@ struct lock_match_data {
        struct ldlm_lock        *lmd_old;
        struct ldlm_lock        *lmd_lock;
        enum ldlm_mode          *lmd_mode;
-       ldlm_policy_data_t      *lmd_policy;
+       union ldlm_policy_data  *lmd_policy;
        __u64                    lmd_flags;
        int                      lmd_unref;
 };
@@ -1063,7 +1063,7 @@ struct lock_match_data {
  */
 static int lock_matches(struct ldlm_lock *lock, struct lock_match_data *data)
 {
-       ldlm_policy_data_t *lpol = &lock->l_policy_data;
+       union ldlm_policy_data *lpol = &lock->l_policy_data;
        enum ldlm_mode match;
 
        if (lock == data->lmd_old)
@@ -1280,7 +1280,7 @@ EXPORT_SYMBOL(ldlm_lock_allow_match);
 enum ldlm_mode ldlm_lock_match(struct ldlm_namespace *ns, __u64 flags,
                               const struct ldlm_res_id *res_id,
                               enum ldlm_type type,
-                              ldlm_policy_data_t *policy,
+                              union ldlm_policy_data *policy,
                               enum ldlm_mode mode,
                               struct lustre_handle *lockh, int unref)
 {
index 0aed39c46154500dcf2059d073fc79694e910812..2603293cc3ddcb6960cd6dceae444abe00ac16c4 100644 (file)
 #include "ldlm_internal.h"
 
 void ldlm_plain_policy_wire_to_local(const ldlm_wire_policy_data_t *wpolicy,
-                                    ldlm_policy_data_t *lpolicy)
+                                    union ldlm_policy_data *lpolicy)
 {
        /* No policy for plain locks */
 }
 
-void ldlm_plain_policy_local_to_wire(const ldlm_policy_data_t *lpolicy,
+void ldlm_plain_policy_local_to_wire(const union ldlm_policy_data *lpolicy,
                                     ldlm_wire_policy_data_t *wpolicy)
 {
        /* No policy for plain locks */
index 836789f67575b0ba409d0c66f1795b4faceb96d6..b772982ea4bc214513923a41043a59b9bd32a9b1 100644 (file)
@@ -682,7 +682,7 @@ static struct ptlrpc_request *ldlm_enqueue_pack(struct obd_export *exp,
 int ldlm_cli_enqueue(struct obd_export *exp, struct ptlrpc_request **reqp,
                     struct ldlm_enqueue_info *einfo,
                     const struct ldlm_res_id *res_id,
-                    ldlm_policy_data_t const *policy, __u64 *flags,
+                    union ldlm_policy_data const *policy, __u64 *flags,
                     void *lvb, __u32 lvb_len, enum lvb_type lvb_type,
                     struct lustre_handle *lockh, int async)
 {
@@ -1528,7 +1528,7 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns, int nr,
  */
 int ldlm_cancel_resource_local(struct ldlm_resource *res,
                               struct list_head *cancels,
-                              ldlm_policy_data_t *policy,
+                              union ldlm_policy_data *policy,
                               enum ldlm_mode mode, __u64 lock_flags,
                               enum ldlm_cancel_flags cancel_flags,
                               void *opaque)
@@ -1645,7 +1645,7 @@ EXPORT_SYMBOL(ldlm_cli_cancel_list);
  */
 int ldlm_cli_cancel_unused_resource(struct ldlm_namespace *ns,
                                    const struct ldlm_res_id *res_id,
-                                   ldlm_policy_data_t *policy,
+                                   union ldlm_policy_data *policy,
                                    enum ldlm_mode mode,
                                    enum ldlm_cancel_flags flags,
                                    void *opaque)
index 28c2501af986cf6f33a6288574b76280805d2e58..6c2abb39416255b111d79b25342455af73d710a9 100644 (file)
@@ -265,7 +265,9 @@ static int ll_md_close(struct obd_export *md_exp, struct inode *inode,
        int lockmode;
        __u64 flags = LDLM_FL_BLOCK_GRANTED | LDLM_FL_TEST_LOCK;
        struct lustre_handle lockh;
-       ldlm_policy_data_t policy = {.l_inodebits = {MDS_INODELOCK_OPEN} };
+       union ldlm_policy_data policy = {
+               .l_inodebits = { MDS_INODELOCK_OPEN }
+       };
        int rc = 0;
 
        /* clear group lock, if present */
@@ -2427,7 +2429,7 @@ ll_file_flock(struct file *file, int cmd, struct file_lock *file_lock)
        };
        struct md_op_data *op_data;
        struct lustre_handle lockh = {0};
-       ldlm_policy_data_t flock = { {0} };
+       union ldlm_policy_data flock = { { 0 } };
        int fl_type = file_lock->fl_type;
        __u64 flags = 0;
        int rc;
@@ -2676,7 +2678,7 @@ int ll_have_md_lock(struct inode *inode, __u64 *bits,
                    enum ldlm_mode l_req_mode)
 {
        struct lustre_handle lockh;
-       ldlm_policy_data_t policy;
+       union ldlm_policy_data policy;
        enum ldlm_mode mode = (l_req_mode == LCK_MINMODE) ?
                              (LCK_CR | LCK_CW | LCK_PR | LCK_PW) : l_req_mode;
        struct lu_fid *fid;
@@ -2717,7 +2719,7 @@ enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits,
                               struct lustre_handle *lockh, __u64 flags,
                               enum ldlm_mode mode)
 {
-       ldlm_policy_data_t policy = { .l_inodebits = {bits} };
+       union ldlm_policy_data policy = { .l_inodebits = { bits } };
        struct lu_fid *fid;
 
        fid = &ll_i2info(inode)->lli_fid;
index c0513bf01388a46ab2ce05220f478826853d687a..50bb328529937e125f605bb1941b3f70ca1925fc 100644 (file)
@@ -905,7 +905,7 @@ static inline struct vvp_io_args *ll_env_args(const struct lu_env *env)
 
 int ll_teardown_mmaps(struct address_space *mapping, __u64 first, __u64 last);
 int ll_file_mmap(struct file *file, struct vm_area_struct *vma);
-void policy_from_vma(ldlm_policy_data_t *policy, struct vm_area_struct *vma,
+void policy_from_vma(union ldlm_policy_data *policy, struct vm_area_struct *vma,
                     unsigned long addr, size_t count);
 struct vm_area_struct *our_vma(struct mm_struct *mm, unsigned long addr,
                               size_t count);
index ad2a699ea2f536031748c9f8e94c175e56ce5644..b56203b4f6e62e263c48dc79fe2f0494c1ff676e 100644 (file)
@@ -47,7 +47,7 @@
 
 static const struct vm_operations_struct ll_file_vm_ops;
 
-void policy_from_vma(ldlm_policy_data_t *policy,
+void policy_from_vma(union ldlm_policy_data *policy,
                     struct vm_area_struct *vma, unsigned long addr,
                     size_t count)
 {
index 33b38bda8319891f8138d94c50a8ef25efeb35ea..2bf3e477fc76c1208f2f1d011cb962c85034ae91 100644 (file)
@@ -370,7 +370,7 @@ static int vvp_mmap_locks(const struct lu_env *env,
        struct mm_struct       *mm = current->mm;
        struct vm_area_struct  *vma;
        struct cl_lock_descr   *descr = &cti->vti_descr;
-       ldlm_policy_data_t      policy;
+       union ldlm_policy_data policy;
        unsigned long      addr;
        ssize_t          count;
        int              result = 0;
index 0e94a585d21f05d5dcd2210daf57524c622ef2b4..f124f6c05ea4a7a34122c959f8c398efe0a859b9 100644 (file)
@@ -1720,7 +1720,7 @@ static int lmv_create(struct obd_export *exp, struct md_op_data *op_data,
 
 static int
 lmv_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
-           const ldlm_policy_data_t *policy,
+           const union ldlm_policy_data *policy,
            struct lookup_intent *it, struct md_op_data *op_data,
            struct lustre_handle *lockh, __u64 extra_lock_flags)
 {
@@ -1816,7 +1816,7 @@ static int lmv_early_cancel(struct obd_export *exp, struct lmv_tgt_desc *tgt,
        struct lu_fid     *fid = md_op_data_fid(op_data, flag);
        struct obd_device      *obd = exp->exp_obd;
        struct lmv_obd   *lmv = &obd->u.lmv;
-       ldlm_policy_data_t      policy = { {0} };
+       union ldlm_policy_data policy = { { 0 } };
        int                  rc = 0;
 
        if (!fid_is_sane(fid))
@@ -2890,8 +2890,9 @@ void lmv_free_memmd(struct lmv_stripe_md *lsm)
 EXPORT_SYMBOL(lmv_free_memmd);
 
 static int lmv_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
-                            ldlm_policy_data_t *policy, enum ldlm_mode mode,
-                            enum ldlm_cancel_flags flags, void *opaque)
+                            union ldlm_policy_data *policy,
+                            enum ldlm_mode mode, enum ldlm_cancel_flags flags,
+                            void *opaque)
 {
        struct obd_device       *obd = exp->exp_obd;
        struct lmv_obd    *lmv = &obd->u.lmv;
@@ -2933,7 +2934,7 @@ static int lmv_set_lock_data(struct obd_export *exp,
 static enum ldlm_mode lmv_lock_match(struct obd_export *exp, __u64 flags,
                                     const struct lu_fid *fid,
                                     enum ldlm_type type,
-                                    ldlm_policy_data_t *policy,
+                                    union ldlm_policy_data *policy,
                                     enum ldlm_mode mode,
                                     struct lustre_handle *lockh)
 {
index d2af8e7d934daa135039953892642fce26d9b443..881c6a0676a6cf3f69576db78a4df7c72173e846 100644 (file)
@@ -75,7 +75,7 @@ int mdc_intent_lock(struct obd_export *exp,
                    __u64 extra_lock_flags);
 
 int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
-               const ldlm_policy_data_t *policy,
+               const union ldlm_policy_data *policy,
                struct lookup_intent *it, struct md_op_data *op_data,
                struct lustre_handle *lockh, __u64 extra_lock_flags);
 
@@ -109,7 +109,7 @@ int mdc_setattr(struct obd_export *exp, struct md_op_data *op_data,
 int mdc_unlink(struct obd_export *exp, struct md_op_data *op_data,
               struct ptlrpc_request **request);
 int mdc_cancel_unused(struct obd_export *exp, const struct lu_fid *fid,
-                     ldlm_policy_data_t *policy, enum ldlm_mode mode,
+                     union ldlm_policy_data *policy, enum ldlm_mode mode,
                      enum ldlm_cancel_flags flags, void *opaque);
 
 int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
@@ -121,7 +121,8 @@ int mdc_intent_getattr_async(struct obd_export *exp,
 
 enum ldlm_mode mdc_lock_match(struct obd_export *exp, __u64 flags,
                              const struct lu_fid *fid, enum ldlm_type type,
-                             ldlm_policy_data_t *policy, enum ldlm_mode mode,
+                             union ldlm_policy_data *policy,
+                             enum ldlm_mode mode,
                              struct lustre_handle *lockh);
 
 static inline int mdc_prep_elc_req(struct obd_export *exp,
index 42a128faf03ceeb6b4da6ef548203ac07f50621a..6494c5bd99d1e660350d3d244e398aa5f316f8ab 100644 (file)
@@ -131,7 +131,8 @@ int mdc_set_lock_data(struct obd_export *exp, const struct lustre_handle *lockh,
 
 enum ldlm_mode mdc_lock_match(struct obd_export *exp, __u64 flags,
                              const struct lu_fid *fid, enum ldlm_type type,
-                             ldlm_policy_data_t *policy, enum ldlm_mode mode,
+                             union ldlm_policy_data *policy,
+                             enum ldlm_mode mode,
                              struct lustre_handle *lockh)
 {
        struct ldlm_res_id res_id;
@@ -147,7 +148,7 @@ enum ldlm_mode mdc_lock_match(struct obd_export *exp, __u64 flags,
 
 int mdc_cancel_unused(struct obd_export *exp,
                      const struct lu_fid *fid,
-                     ldlm_policy_data_t *policy,
+                     union ldlm_policy_data *policy,
                      enum ldlm_mode mode,
                      enum ldlm_cancel_flags flags,
                      void *opaque)
@@ -686,20 +687,20 @@ static int mdc_finish_enqueue(struct obd_export *exp,
  * we don't know in advance the file type.
  */
 int mdc_enqueue(struct obd_export *exp, struct ldlm_enqueue_info *einfo,
-               const ldlm_policy_data_t *policy,
+               const union ldlm_policy_data *policy,
                struct lookup_intent *it, struct md_op_data *op_data,
                struct lustre_handle *lockh, u64 extra_lock_flags)
 {
-       static const ldlm_policy_data_t lookup_policy = {
+       static const union ldlm_policy_data lookup_policy = {
                .l_inodebits = { MDS_INODELOCK_LOOKUP }
        };
-       static const ldlm_policy_data_t update_policy = {
+       static const union ldlm_policy_data update_policy = {
                .l_inodebits = { MDS_INODELOCK_UPDATE }
        };
-       static const ldlm_policy_data_t layout_policy = {
+       static const union ldlm_policy_data layout_policy = {
                .l_inodebits = { MDS_INODELOCK_LAYOUT }
        };
-       static const ldlm_policy_data_t getxattr_policy = {
+       static const union ldlm_policy_data getxattr_policy = {
                .l_inodebits = { MDS_INODELOCK_XATTR }
        };
        struct obd_device *obddev = class_exp2obd(exp);
@@ -925,7 +926,7 @@ static int mdc_finish_intent_lock(struct obd_export *exp,
         */
        lock = ldlm_handle2lock(lockh);
        if (lock) {
-               ldlm_policy_data_t policy = lock->l_policy_data;
+               union ldlm_policy_data policy = lock->l_policy_data;
 
                LDLM_DEBUG(lock, "matching against this");
 
@@ -961,7 +962,7 @@ int mdc_revalidate_lock(struct obd_export *exp, struct lookup_intent *it,
         */
        struct ldlm_res_id res_id;
        struct lustre_handle lockh;
-       ldlm_policy_data_t policy;
+       union ldlm_policy_data policy;
        enum ldlm_mode mode;
 
        if (it->it_lock_handle) {
@@ -1163,10 +1164,9 @@ int mdc_intent_getattr_async(struct obd_export *exp,
         *     for statahead currently. Consider CMD in future, such two bits
         *     maybe managed by different MDS, should be adjusted then.
         */
-       ldlm_policy_data_t       policy = {
-                                       .l_inodebits = { MDS_INODELOCK_LOOKUP |
-                                                        MDS_INODELOCK_UPDATE }
-                                };
+       union ldlm_policy_data policy = {
+               .l_inodebits = { MDS_INODELOCK_LOOKUP | MDS_INODELOCK_UPDATE }
+       };
        int                   rc = 0;
        __u64               flags = LDLM_FL_HAS_INTENT;
 
index b551c5711db9f3941f951284a205ae53f6a759c7..51195884520aa28563006a82e741b71983988e55 100644 (file)
@@ -66,7 +66,7 @@ int mdc_resource_get_unused(struct obd_export *exp, const struct lu_fid *fid,
                            __u64 bits)
 {
        struct ldlm_namespace *ns = exp->exp_obd->obd_namespace;
-       ldlm_policy_data_t policy = {};
+       union ldlm_policy_data policy = {};
        struct ldlm_res_id res_id;
        struct ldlm_resource *res;
        int count;
index a2cd5dd25114e07645154c66c836dfe4d23b6ef8..23600fbab091d4416333c10aaa71d050592c26fd 100644 (file)
@@ -886,7 +886,7 @@ static int mgc_set_mgs_param(struct obd_export *exp,
 
 /* Take a config lock so we can get cancel notifications */
 static int mgc_enqueue(struct obd_export *exp, __u32 type,
-                      ldlm_policy_data_t *policy, __u32 mode,
+                      union ldlm_policy_data *policy, __u32 mode,
                       __u64 *flags, void *bl_cb, void *cp_cb, void *gl_cb,
                       void *data, __u32 lvb_len, void *lvb_swabber,
                       struct lustre_handle *lockh)
index c9470d1a185d2e4b9c47dc8e840f6cfdfe26dfcc..bf05a2d2bfe33e85c5a60abbd3ca223338b3fc3d 100644 (file)
@@ -95,7 +95,7 @@ struct osc_session {
 #define OTI_PVEC_SIZE 256
 struct osc_thread_info {
        struct ldlm_res_id      oti_resname;
-       ldlm_policy_data_t      oti_policy;
+       union ldlm_policy_data  oti_policy;
        struct cl_lock_descr    oti_descr;
        struct cl_attr    oti_attr;
        struct lustre_handle    oti_handle;
@@ -394,7 +394,8 @@ struct lu_object *osc_object_alloc(const struct lu_env *env,
 int osc_page_init(const struct lu_env *env, struct cl_object *obj,
                  struct cl_page *page, pgoff_t ind);
 
-void osc_index2policy(ldlm_policy_data_t *policy, const struct cl_object *obj,
+void osc_index2policy(union ldlm_policy_data *policy,
+                     const struct cl_object *obj,
                      pgoff_t start, pgoff_t end);
 int osc_lvb_print(const struct lu_env *env, void *cookie,
                  lu_printer_t p, const struct ost_lvb *lvb);
index 12d3b589f39f4cf26fd8ae5a72ae063cec021ea9..981b7e17d3b8baa0d9ac0e4e47be4dd3ec2516b2 100644 (file)
@@ -107,14 +107,14 @@ typedef int (*osc_enqueue_upcall_f)(void *cookie, struct lustre_handle *lockh,
                                    int rc);
 
 int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
-                    __u64 *flags, ldlm_policy_data_t *policy,
+                    __u64 *flags, union ldlm_policy_data *policy,
                     struct ost_lvb *lvb, int kms_valid,
                     osc_enqueue_upcall_f upcall,
                     void *cookie, struct ldlm_enqueue_info *einfo,
                     struct ptlrpc_request_set *rqset, int async, int agl);
 
 int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
-                  __u32 type, ldlm_policy_data_t *policy, __u32 mode,
+                  __u32 type, union ldlm_policy_data *policy, __u32 mode,
                   __u64 *flags, void *data, struct lustre_handle *lockh,
                   int unref);
 
index bfc8d384f6b5a4a4d4f1babcc66ac68e8564f86e..130460d80e7094a4cf2203fb797e05f5385aaabc 100644 (file)
@@ -145,7 +145,7 @@ static void osc_lock_fini(const struct lu_env *env,
 
 static void osc_lock_build_policy(const struct lu_env *env,
                                  const struct cl_lock *lock,
-                                 ldlm_policy_data_t *policy)
+                                 union ldlm_policy_data *policy)
 {
        const struct cl_lock_descr *d = &lock->cll_descr;
 
@@ -914,7 +914,7 @@ static int osc_lock_enqueue(const struct lu_env *env,
        struct osc_lock *oscl = cl2osc_lock(slice);
        struct cl_lock *lock = slice->cls_lock;
        struct ldlm_res_id *resname = &info->oti_resname;
-       ldlm_policy_data_t *policy = &info->oti_policy;
+       union ldlm_policy_data *policy = &info->oti_policy;
        osc_enqueue_upcall_f upcall = osc_lock_upcall;
        void *cookie = oscl;
        bool async = false;
@@ -1186,7 +1186,7 @@ struct ldlm_lock *osc_dlmlock_at_pgoff(const struct lu_env *env,
 {
        struct osc_thread_info *info = osc_env_info(env);
        struct ldlm_res_id *resname = &info->oti_resname;
-       ldlm_policy_data_t *policy  = &info->oti_policy;
+       union ldlm_policy_data *policy = &info->oti_policy;
        struct lustre_handle lockh;
        struct ldlm_lock *lock = NULL;
        enum ldlm_mode mode;
index ab1c11c5a9f2c697405074d8610e3d90c06f2435..35927960ac99e74b312eff1d1fdb0205cff49fa9 100644 (file)
@@ -223,7 +223,7 @@ static int osc_object_fiemap(const struct lu_env *env, struct cl_object *obj,
                             struct fiemap *fiemap, size_t *buflen)
 {
        struct obd_export *exp = osc_export(cl2osc(obj));
-       ldlm_policy_data_t policy;
+       union ldlm_policy_data policy;
        struct ptlrpc_request *req;
        struct lustre_handle lockh;
        struct ldlm_res_id resid;
index 93248d1fb314831b4d649d65cea270d4bcf16a8c..7a1f102363dfd6d0d2f186b28d6e86077cb62a69 100644 (file)
@@ -109,7 +109,8 @@ int osc_page_cache_add(const struct lu_env *env,
        return result;
 }
 
-void osc_index2policy(ldlm_policy_data_t *policy, const struct cl_object *obj,
+void osc_index2policy(union ldlm_policy_data *policy,
+                     const struct cl_object *obj,
                      pgoff_t start, pgoff_t end)
 {
        memset(policy, 0, sizeof(*policy));
index 7f19cfa80fa84bc76b3bd891b84b153c629b239f..4d4d3ebf0a4da3bc28e6b9dfe23a08d4b5d462d3 100644 (file)
@@ -1953,7 +1953,7 @@ struct ptlrpc_request_set *PTLRPCD_SET = (void *)1;
  * release locks just after they are obtained.
  */
 int osc_enqueue_base(struct obd_export *exp, struct ldlm_res_id *res_id,
-                    __u64 *flags, ldlm_policy_data_t *policy,
+                    __u64 *flags, union ldlm_policy_data *policy,
                     struct ost_lvb *lvb, int kms_valid,
                     osc_enqueue_upcall_f upcall, void *cookie,
                     struct ldlm_enqueue_info *einfo,
@@ -2104,7 +2104,7 @@ no_match:
 }
 
 int osc_match_base(struct obd_export *exp, struct ldlm_res_id *res_id,
-                  __u32 type, ldlm_policy_data_t *policy, __u32 mode,
+                  __u32 type, union ldlm_policy_data *policy, __u32 mode,
                   __u64 *flags, void *data, struct lustre_handle *lockh,
                   int unref)
 {