Merge branch 'work.adfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull adfs updates from Al Viro: "More ADFS patches from Russell King" * 'work.adfs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: fs/adfs: add time stamp and file type helpers fs/adfs: super: limit idlen according to directory type fs/adfs: super: fix use-after-free bug fs/adfs: super: safely update options on remount fs/adfs: super: correct superblock flags fs/adfs: clean up indirect disc addresses and fragment IDs fs/adfs: clean up error message printing fs/adfs: use %pV for error messages fs/adfs: use format_version from disc_record fs/adfs: add helper to get filesystem size fs/adfs: add helper to get discrecord from map fs/adfs: correct disc record structure
This commit is contained in:
@@ -94,7 +94,7 @@ adfs_atts2mode(struct super_block *sb, struct inode *inode)
|
||||
return S_IFDIR | S_IXUGO | mode;
|
||||
}
|
||||
|
||||
switch (ADFS_I(inode)->filetype) {
|
||||
switch (adfs_filetype(ADFS_I(inode)->loadaddr)) {
|
||||
case 0xfc0: /* LinkFS */
|
||||
return S_IFLNK|S_IRWXUGO;
|
||||
|
||||
@@ -174,7 +174,7 @@ adfs_adfs2unix_time(struct timespec64 *tv, struct inode *inode)
|
||||
2208988800000000000LL;
|
||||
s64 nsec;
|
||||
|
||||
if (ADFS_I(inode)->stamped == 0)
|
||||
if (!adfs_inode_is_stamped(inode))
|
||||
goto cur_time;
|
||||
|
||||
high = ADFS_I(inode)->loadaddr & 0xFF; /* top 8 bits of timestamp */
|
||||
@@ -213,7 +213,7 @@ adfs_unix2adfs_time(struct inode *inode, unsigned int secs)
|
||||
{
|
||||
unsigned int high, low;
|
||||
|
||||
if (ADFS_I(inode)->stamped) {
|
||||
if (adfs_inode_is_stamped(inode)) {
|
||||
/* convert 32-bit seconds to 40-bit centi-seconds */
|
||||
low = (secs & 255) * 100;
|
||||
high = (secs / 256) * 100 + (low >> 8) + 0x336e996a;
|
||||
@@ -247,7 +247,7 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
|
||||
|
||||
inode->i_uid = ADFS_SB(sb)->s_uid;
|
||||
inode->i_gid = ADFS_SB(sb)->s_gid;
|
||||
inode->i_ino = obj->file_id;
|
||||
inode->i_ino = obj->indaddr;
|
||||
inode->i_size = obj->size;
|
||||
set_nlink(inode, 2);
|
||||
inode->i_blocks = (inode->i_size + sb->s_blocksize - 1) >>
|
||||
@@ -263,8 +263,6 @@ adfs_iget(struct super_block *sb, struct object_info *obj)
|
||||
ADFS_I(inode)->loadaddr = obj->loadaddr;
|
||||
ADFS_I(inode)->execaddr = obj->execaddr;
|
||||
ADFS_I(inode)->attr = obj->attr;
|
||||
ADFS_I(inode)->filetype = obj->filetype;
|
||||
ADFS_I(inode)->stamped = ((obj->loadaddr & 0xfff00000) == 0xfff00000);
|
||||
|
||||
inode->i_mode = adfs_atts2mode(sb, inode);
|
||||
adfs_adfs2unix_time(&inode->i_mtime, inode);
|
||||
@@ -355,7 +353,7 @@ int adfs_write_inode(struct inode *inode, struct writeback_control *wbc)
|
||||
struct object_info obj;
|
||||
int ret;
|
||||
|
||||
obj.file_id = inode->i_ino;
|
||||
obj.indaddr = inode->i_ino;
|
||||
obj.name_len = 0;
|
||||
obj.parent_id = ADFS_I(inode)->parent_id;
|
||||
obj.loadaddr = ADFS_I(inode)->loadaddr;
|
||||
|
Reference in New Issue
Block a user