[LU-12885] improve variable naming to clarify code usage Created: 19/Oct/19  Updated: 22/Apr/23

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: Andreas Dilger
Resolution: Unresolved Votes: 0
Labels: None

Rank (Obsolete): 9223372036854775807

 Description   

There are lots of places in the code that have very generic variable names like "flags" or "mask" that are confusing to distinguish in places, because it isn't clear what the type of values those flags hold.

Add named enums for the variables where possible to make it very clear what type of flag is being used, and/or rename the variable to help make this clear. In a couple of cases the variable type is determined by the kernel API and cannot be changed.



 Comments   
Comment by Gerrit Updater [ 21/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36519
Subject: LU-12885 llite: mark extended attr and inode flags
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 217db7daafc917a14b150884e61cd3cc17662105

Comment by Gerrit Updater [ 21/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36520
Subject: LU-12885 mdd: clearly name variables for MAY_ flags
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 1249c8fb774a5aa0aaac0521f31b9162db3fc29f

Comment by Gerrit Updater [ 21/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36521
Subject: LU-12885 mdc: remove flags argument from pack functions
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 901e6431093d67f3ff3f55afd22d487cdf1dfac0

Comment by Gerrit Updater [ 21/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36522
Subject: LU-12885 mdd: only bottom of clf_flags in changelog
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 101e948642bf64c3985be6e6930c7c26e36e6c33

Comment by Gerrit Updater [ 21/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36523
Subject: LU-12885 osd: rename xattr operation flags consistently
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 39a42d686a18c442c3434b1751ddee9f806783c9

Comment by Gerrit Updater [ 21/Oct/19 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/36524
Subject: LU-12885 llapi: use enum llapi_layout_get_flags
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: e49613a28af050a33a021333fda3b3bf082ba15d

Comment by Gerrit Updater [ 23/Sep/20 ]

Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/40008
Subject: LU-12885 osd: rename xattr operation flags consistently
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 0420d3815133f5264801cc524dd2064e29bbb31a

Comment by Gerrit Updater [ 06/Mar/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36519/
Subject: LU-12885 llite: mark extended attr and inode flags
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: b51a1e1140cac80c0590183be05e905bf87294d4

Comment by Gerrit Updater [ 06/Mar/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36520/
Subject: LU-12885 mdd: clearly name variables for MAY_ flags
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 76b9cf2565eb7a5dff65bf508d5762a109345f5d

Comment by Gerrit Updater [ 13/Mar/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/33512/
Subject: LU-12885 mds: add enums for MDS_ATTR flags
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 6c6b8cb972ac92c08dd91d25e57cc6a3703d951e

Comment by Gerrit Updater [ 28/Apr/21 ]

Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36524/
Subject: LU-12885 llapi: use enum llapi_layout_get_flags
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: ae98601fed3e99af5376311cb4b02d2c65ccd1fe

Comment by Gerrit Updater [ 23/Dec/21 ]

"Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/45924
Subject: LU-12885 llite: add enum ll_file_flags for clarity
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c73f2401ae794d1186568b43871cdfe61703ec16

Comment by Gerrit Updater [ 22/Apr/23 ]

"Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/c/fs/lustre-release/+/36522/
Subject: LU-12885 mdd: only bottom of clf_flags in changelog
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 3b43457cf150c03c496be72265d09574ea470308

Generated at Sat Feb 10 02:56:29 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.