scoutfs: Tidy some enum usage

Prefer named to anonymous enums. This helps readability a little.

Use enum as param type if possible (a couple spots).

Remove unused enum in lock_server.c.

Define enum spbm_flags using shift notation for consistency.

Rename get_file_block()'s "gfb" parameter to "flags" for consistency.

Signed-off-by: Andy Grover <agrover@versity.com>
This commit is contained in:
Andy Grover
2020-11-30 13:35:44 -08:00
committed by Zach Brown
parent 73333af364
commit cf278f5fa0
13 changed files with 25 additions and 31 deletions
+3 -3
View File
@@ -78,7 +78,7 @@ static unsigned int mode_to_type(umode_t mode)
#undef S_SHIFT
}
static unsigned int dentry_type(unsigned int type)
static unsigned int dentry_type(enum scoutfs_dentry_type type)
{
static unsigned char types[] = {
[SCOUTFS_DT_FIFO] = DT_FIFO,
@@ -988,12 +988,12 @@ static void init_symlink_key(struct scoutfs_key *key, u64 ino, u8 nr)
* The target name can be null for deletion when val isn't used. Size
* still has to be provided to determine the number of items.
*/
enum {
enum symlink_ops {
SYM_CREATE = 0,
SYM_LOOKUP,
SYM_DELETE,
};
static int symlink_item_ops(struct super_block *sb, int op, u64 ino,
static int symlink_item_ops(struct super_block *sb, enum symlink_ops op, u64 ino,
struct scoutfs_lock *lock, const char *target,
size_t size)
{