diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-12-09 11:11:38 +0000 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2020-01-20 20:12:42 -0500 |
commit | 25e5d4df3b46a345dccc0a07f998ce443077b4ff (patch) | |
tree | f014209fd64fd0bbcb03bc8e82e0b41ba804184f /fs/adfs | |
parent | 08ead1b8b98d90795bf934d93a718328d11f6ce6 (diff) | |
download | linux-25e5d4df3b46a345dccc0a07f998ce443077b4ff.tar.gz linux-25e5d4df3b46a345dccc0a07f998ce443077b4ff.tar.bz2 linux-25e5d4df3b46a345dccc0a07f998ce443077b4ff.zip |
fs/adfs: mostly divorse inode number from indirect disc address
Avoid using the inode number as the indirect disc address, even though
these currently have the same value.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/adfs')
-rw-r--r-- | fs/adfs/adfs.h | 1 | ||||
-rw-r--r-- | fs/adfs/dir.c | 4 | ||||
-rw-r--r-- | fs/adfs/inode.c | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/fs/adfs/adfs.h b/fs/adfs/adfs.h index c05555252fec..699c4fa8b78b 100644 --- a/fs/adfs/adfs.h +++ b/fs/adfs/adfs.h @@ -32,6 +32,7 @@ static inline u16 adfs_filetype(u32 loadaddr) struct adfs_inode_info { loff_t mmu_private; __u32 parent_id; /* parent indirect disc address */ + __u32 indaddr; /* object indirect disc address */ __u32 loadaddr; /* RISC OS load address */ __u32 execaddr; /* RISC OS exec address */ unsigned int attr; /* RISC OS permissions */ diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index dd940f17767d..77fbd196008f 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -158,7 +158,7 @@ static int adfs_dir_read_inode(struct super_block *sb, struct inode *inode, { int ret; - ret = adfs_dir_read(sb, inode->i_ino, inode->i_size, dir); + ret = adfs_dir_read(sb, ADFS_I(inode)->indaddr, inode->i_size, dir); if (ret) return ret; @@ -372,7 +372,7 @@ static int adfs_dir_lookup_byname(struct inode *inode, const struct qstr *qstr, break; } } - obj->parent_id = inode->i_ino; + obj->parent_id = ADFS_I(inode)->indaddr; unlock_relse: up_read(&adfs_dir_rwsem); diff --git a/fs/adfs/inode.c b/fs/adfs/inode.c index 212a56fc7911..32620f4a7623 100644 --- a/fs/adfs/inode.c +++ b/fs/adfs/inode.c @@ -20,7 +20,8 @@ adfs_get_block(struct inode *inode, sector_t block, struct buffer_head *bh, if (block >= inode->i_blocks) goto abort_toobig; - block = __adfs_block_map(inode->i_sb, inode->i_ino, block); + block = __adfs_block_map(inode->i_sb, ADFS_I(inode)->indaddr, + block); if (block) map_bh(bh, inode->i_sb, block); return 0; @@ -259,6 +260,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj) * for cross-directory renames. */ ADFS_I(inode)->parent_id = obj->parent_id; + ADFS_I(inode)->indaddr = obj->indaddr; ADFS_I(inode)->loadaddr = obj->loadaddr; ADFS_I(inode)->execaddr = obj->execaddr; ADFS_I(inode)->attr = obj->attr; @@ -353,7 +355,7 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc) struct object_info obj; int ret; - obj.indaddr = inode->i_ino; + obj.indaddr = ADFS_I(inode)->indaddr; obj.name_len = 0; obj.parent_id = ADFS_I(inode)->parent_id; obj.loadaddr = ADFS_I(inode)->loadaddr; |