From: Arshad Hussain Date: Wed, 30 Oct 2024 06:52:34 +0000 (-0400) Subject: LU-18420 llite: Use enum mds_ibits_locks instead of __u64 X-Git-Tag: 2.16.51~56 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F77%2F56877%2F5;p=fs%2Flustre-release.git LU-18420 llite: Use enum mds_ibits_locks instead of __u64 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 Change-Id: I2d9ad5001977a532f2d7c3242ce2e40f38974c5e Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56877 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 5155f59..9a55e15 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -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); diff --git a/lustre/llite/file.c b/lustre/llite/file.c index e85d593e..a3803ff 100644 --- a/lustre/llite/file.c +++ b/lustre/llite/file.c @@ -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; diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index de159a8..ca2a985 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -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); diff --git a/lustre/llite/namei.c b/lustre/llite/namei.c index 1639d78..1861563 100644 --- a/lustre/llite/namei.c +++ b/lustre/llite/namei.c @@ -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))