diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-03-24 16:22:28 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-05-31 12:30:57 +0300 |
commit | adb514a4e0f6d87ff43d1bc0a948c38530a0dc83 (patch) | |
tree | a02ad23959cab97dc61b30e96eb925dc16d1eaed /fs/adfs/dir.c | |
parent | 411c49bcf32d36b9988dc27968a92f3edf8ebed1 (diff) | |
download | linux-adb514a4e0f6d87ff43d1bc0a948c38530a0dc83.tar.xz |
fs/adfs: factor out filename fixup
Move the filename fixup to adfs_object_fixup() so we only have one
implementation of this.
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.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index 03490f16300d..877d5cffe9e9 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -18,6 +18,19 @@ static DEFINE_RWLOCK(adfs_dir_lock); void adfs_object_fixup(struct adfs_dir *dir, struct object_info *obj) { + unsigned int i; + + /* + * RISC OS allows the use of '/' in directory entry names, so we need + * to fix these up. '/' is typically used for FAT compatibility to + * represent '.', so do the same conversion here. In any case, '.' + * will never be in a RISC OS name since it is used as the pathname + * separator. + */ + for (i = 0; i < obj->name_len; i++) + if (obj->name[i] == '/') + obj->name[i] = '.'; + obj->filetype = -1; /* |