Whamcloud - gitweb
LU-18420 llite: Use enum mds_ibits_locks instead of __u64 77/56877/5
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Wed, 30 Oct 2024 06:52:34 +0000 (02:52 -0400)
committerOleg Drokin <green@whamcloud.com>
Mon, 16 Dec 2024 08:17:25 +0000 (08:17 +0000)
This patch uses enum mds_ibits_locks instead of generic
__u64. This patch has no functional changes.

Test-Parameters: trivial
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I2d9ad5001977a532f2d7c3242ce2e40f38974c5e
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56877
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/dir.c
lustre/llite/file.c
lustre/llite/llite_internal.h
lustre/llite/namei.c

index 5155f59..9a55e15 100644 (file)
@@ -358,7 +358,7 @@ static int ll_readdir(struct file *filp, void *cookie, filldir_t filldir)
                /* Only needed for striped dir to fill ..see lmv_read_page() */
                if (i_dir) {
                        struct obd_export *exp = ll_i2mdexp(i_dir);
-                       __u64 ibits = MDS_INODELOCK_LOOKUP;
+                       enum mds_ibits_locks ibits = MDS_INODELOCK_LOOKUP;
 
                        if (ll_have_md_lock(exp, i_dir, &ibits, LCK_MINMODE))
                                pfid = *ll_inode2fid(i_dir);
index e85d593..a3803ff 100644 (file)
@@ -5878,8 +5878,8 @@ ll_file_noflock(struct file *file, int cmd, struct file_lock *file_lock)
  * \param l_req_mode [IN] searched lock mode
  * \retval boolean, true iff all bits are found
  */
-int ll_have_md_lock(struct obd_export *exp, struct inode *inode, __u64 *bits,
-                   enum ldlm_mode l_req_mode)
+int ll_have_md_lock(struct obd_export *exp, struct inode *inode,
+                   enum mds_ibits_locks *bits, enum ldlm_mode l_req_mode)
 {
        struct lustre_handle lockh;
        union ldlm_policy_data policy;
index de159a8..ca2a985 100644 (file)
@@ -1383,7 +1383,8 @@ extern const struct address_space_operations ll_aops;
 extern const struct inode_operations ll_file_inode_operations;
 const struct file_operations *ll_select_file_operations(struct ll_sb_info *sbi);
 extern int ll_have_md_lock(struct obd_export *exp, struct inode *inode,
-                          __u64 *bits, enum ldlm_mode l_req_mode);
+                          enum mds_ibits_locks *bits,
+                          enum ldlm_mode l_req_mode);
 extern enum ldlm_mode ll_take_md_lock(struct inode *inode, __u64 bits,
                                      struct lustre_handle *lockh, __u64 flags,
                                      enum ldlm_mode mode);
index 1639d78..1861563 100644 (file)
@@ -245,11 +245,11 @@ static int ll_dom_lock_cancel(struct inode *inode, struct ldlm_lock *lock)
        RETURN(rc);
 }
 
-static void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel)
+static void ll_lock_cancel_bits(struct ldlm_lock *lock,
+                               enum mds_ibits_locks bits)
 {
        struct inode *inode = ll_inode_from_resource_lock(lock);
        struct ll_inode_info *lli;
-       __u64 bits = to_cancel;
        int rc;
 
        ENTRY;
@@ -412,15 +412,16 @@ static void ll_lock_cancel_bits(struct ldlm_lock *lock, __u64 to_cancel)
 static int ll_md_need_convert(struct ldlm_lock *lock)
 {
        struct ldlm_namespace *ns = ldlm_lock_to_ns(lock);
-       struct inode *inode;
        __u64 wanted = lock->l_policy_data.l_inodebits.cancel_bits;
-       __u64 bits = lock->l_policy_data.l_inodebits.bits & ~wanted;
        enum ldlm_mode mode = LCK_MINMODE;
+       enum mds_ibits_locks bits;
+       struct inode *inode;
 
        if (!lock->l_conn_export ||
            !exp_connect_lock_convert(lock->l_conn_export))
                return 0;
 
+       bits = lock->l_policy_data.l_inodebits.bits & ~wanted;
        if (!wanted || !bits || ldlm_is_cancel(lock))
                return 0;
 
@@ -477,7 +478,7 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *ld,
        switch (flag) {
        case LDLM_CB_BLOCKING:
        {
-               __u64 cancel_flags = LCF_ASYNC;
+               enum ldlm_cancel_flags cancel_flags = LCF_ASYNC;
 
                /* if lock convert is not needed then still have to
                 * pass lock via ldlm_cli_convert() to keep all states
@@ -504,7 +505,8 @@ int ll_md_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *ld,
        }
        case LDLM_CB_CANCELING:
        {
-               __u64 to_cancel = lock->l_policy_data.l_inodebits.bits;
+               enum mds_ibits_locks to_cancel =
+                                       lock->l_policy_data.l_inodebits.bits;
 
                /* Nothing to do for non-granted locks */
                if (!ldlm_is_granted(lock))