diff options
author | plougher <plougher> | 2008-10-23 08:30:39 +0000 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:34:09 -0800 |
commit | 2370ab257e7316ed64e110735265b6e78624e372 (patch) | |
tree | d5a6bc1ef02692d3e4dcf8fc296eb7126aa57f7f /kernel/fs | |
parent | 1aef9e4f12365714fd95ac9a7a059ea4c7d6d846 (diff) | |
download | squashfs-tools-2370ab257e7316ed64e110735265b6e78624e372.tar.gz |
Fix some horrible code
Diffstat (limited to 'kernel/fs')
-rw-r--r-- | kernel/fs/squashfs/inode.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/fs/squashfs/inode.c b/kernel/fs/squashfs/inode.c index ca91e88..9095230 100644 --- a/kernel/fs/squashfs/inode.c +++ b/kernel/fs/squashfs/inode.c @@ -301,9 +301,11 @@ int squashfs_read_inode(struct inode *inode, long long ino) if (err < 0) goto failed_read; + if (type == SQUASHFS_CHRDEV_TYPE) + inode->i_mode = S_IFCHR; + else + inode->i_mode = S_IFBLK; inode->i_nlink = le32_to_cpu(sqsh_ino->nlink); - inode->i_mode |= (type == SQUASHFS_CHRDEV_TYPE) - ? S_IFCHR : S_IFBLK; rdev = le32_to_cpu(sqsh_ino->rdev); init_special_inode(inode, le16_to_cpu(inode->i_mode), new_decode_dev(rdev)); @@ -321,9 +323,11 @@ int squashfs_read_inode(struct inode *inode, long long ino) if (err < 0) goto failed_read; + if (type == SQUASHFS_CHRDEV_TYPE) + inode->i_mode = S_IFCHR; + else + inode->i_mode = S_IFBLK; inode->i_nlink = le32_to_cpu(sqsh_ino->nlink); - inode->i_mode |= (type == SQUASHFS_FIFO_TYPE) - ? S_IFIFO : S_IFSOCK; init_special_inode(inode, le16_to_cpu(inode->i_mode), 0); break; } |