summaryrefslogtreecommitdiff
path: root/fs/adfs/dir.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2019-03-24 16:08:41 +0300
committerRussell King <rmk+kernel@armlinux.org.uk>2019-05-31 12:31:05 +0300
commit5f8de4875c3522addcde6e98f978e0414c16478d (patch)
tree867a72191974d33515dce83e1bc45d03339b3c0f /fs/adfs/dir.c
parent2eb0684f977123bfa5a565a57d219870085b78e8 (diff)
downloadlinux-5f8de4875c3522addcde6e98f978e0414c16478d.tar.xz
fs/adfs: move append_filetype_suffix() into adfs_object_fixup()
append_filetype_suffix() is now only used in adfs_object_fixup(), so move it there. Acked-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'fs/adfs/dir.c')
-rw-r--r--fs/adfs/dir.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index 5d88108339df..51ed80ff10a5 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -42,11 +42,14 @@ void adfs_object_fixup(struct adfs_dir *dir, struct object_info *obj)
obj->filetype = (__u16) ((0x000fff00 & obj->loadaddr) >> 8);
/* optionally append the ,xyz hex filetype suffix */
- if (ADFS_SB(dir->sb)->s_ftsuffix)
- obj->name_len +=
- append_filetype_suffix(
- &obj->name[obj->name_len],
- obj->filetype);
+ if (ADFS_SB(dir->sb)->s_ftsuffix) {
+ __u16 filetype = obj->filetype;
+
+ obj->name[obj->name_len++] = ',';
+ obj->name[obj->name_len++] = hex_asc_lo(filetype >> 8);
+ obj->name[obj->name_len++] = hex_asc_lo(filetype >> 4);
+ obj->name[obj->name_len++] = hex_asc_lo(filetype >> 0);
+ }
}
}