diff options
author | Jan Cincera <hcincera@gmail.com> | 2023-10-30 12:53:18 +0100 |
---|---|---|
committer | Namjae Jeon <linkinjeon@kernel.org> | 2023-10-31 02:00:51 +0100 |
commit | 0ab8ba71868594acfc717b8c7d1738b9118118ec (patch) | |
tree | 7a079e6a5180dcd8464ea2f3527f85e79ce46055 /fs/exfat/dir.c | |
parent | Merge tag 'objtool-core-2023-10-28' of git://git.kernel.org/pub/scm/linux/ker... (diff) | |
download | linux-0ab8ba71868594acfc717b8c7d1738b9118118ec.tar.xz linux-0ab8ba71868594acfc717b8c7d1738b9118118ec.zip |
exfat: add ioctls for accessing attributes
Add GET and SET attributes ioctls to enable attribute modification.
We already do this in FAT and a few userspace utils made for it would
benefit from this also working on exFAT, namely fatattr.
Signed-off-by: Jan Cincera <hcincera@gmail.com>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Diffstat (limited to 'fs/exfat/dir.c')
-rw-r--r-- | fs/exfat/dir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/exfat/dir.c b/fs/exfat/dir.c index e1586bba6d86..fdd46aa466e1 100644 --- a/fs/exfat/dir.c +++ b/fs/exfat/dir.c @@ -287,7 +287,7 @@ get_new: mutex_unlock(&EXFAT_SB(sb)->s_lock); if (!dir_emit(ctx, nb->lfn, strlen(nb->lfn), inum, - (de.attr & ATTR_SUBDIR) ? DT_DIR : DT_REG)) + (de.attr & EXFAT_ATTR_SUBDIR) ? DT_DIR : DT_REG)) goto out; ctx->pos = cpos; goto get_new; @@ -359,7 +359,7 @@ unsigned int exfat_get_entry_type(struct exfat_dentry *ep) if (ep->type == EXFAT_VOLUME) return TYPE_VOLUME; if (ep->type == EXFAT_FILE) { - if (le16_to_cpu(ep->dentry.file.attr) & ATTR_SUBDIR) + if (le16_to_cpu(ep->dentry.file.attr) & EXFAT_ATTR_SUBDIR) return TYPE_DIR; return TYPE_FILE; } @@ -410,10 +410,10 @@ static void exfat_set_entry_type(struct exfat_dentry *ep, unsigned int type) ep->type = EXFAT_VOLUME; } else if (type == TYPE_DIR) { ep->type = EXFAT_FILE; - ep->dentry.file.attr = cpu_to_le16(ATTR_SUBDIR); + ep->dentry.file.attr = cpu_to_le16(EXFAT_ATTR_SUBDIR); } else if (type == TYPE_FILE) { ep->type = EXFAT_FILE; - ep->dentry.file.attr = cpu_to_le16(ATTR_ARCHIVE); + ep->dentry.file.attr = cpu_to_le16(EXFAT_ATTR_ARCHIVE); } } |