diff options
author | plougher <plougher> | 2008-10-23 08:21:37 +0000 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-02-23 12:34:08 -0800 |
commit | 76f489f44f7082158ac125800bf941f1c7e8466d (patch) | |
tree | 606d73e1eab183ad3de7d19beea300e16e0dd1f8 /kernel | |
parent | 2c2000a3ee6528d6260dfb7c28ad1730ce351f2e (diff) | |
download | squashfs-tools-76f489f44f7082158ac125800bf941f1c7e8466d.tar.gz |
Shorten a bunch of vars in squashfs_inode_info
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/fs/squashfs/dir.c | 10 | ||||
-rw-r--r-- | kernel/fs/squashfs/export.c | 2 | ||||
-rw-r--r-- | kernel/fs/squashfs/file.c | 4 | ||||
-rw-r--r-- | kernel/fs/squashfs/inode.c | 50 | ||||
-rw-r--r-- | kernel/fs/squashfs/namei.c | 11 | ||||
-rw-r--r-- | kernel/fs/squashfs/symlink.c | 6 | ||||
-rw-r--r-- | kernel/include/linux/squashfs_fs_i.h | 10 |
7 files changed, 46 insertions, 47 deletions
diff --git a/kernel/fs/squashfs/dir.c b/kernel/fs/squashfs/dir.c index 6615b23..84248f4 100644 --- a/kernel/fs/squashfs/dir.c +++ b/kernel/fs/squashfs/dir.c @@ -107,7 +107,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) { struct inode *inode = file->f_dentry->d_inode; struct squashfs_sb_info *msblk = inode->i_sb->s_fs_info; - long long block = SQUASHFS_I(inode)->start_block + + long long block = SQUASHFS_I(inode)->start + msblk->directory_table_start; int offset = SQUASHFS_I(inode)->offset, length = 0, dir_count, size, type, err; @@ -142,7 +142,7 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) } else { name = ".."; size = 2; - i_ino = SQUASHFS_I(inode)->parent_inode; + i_ino = SQUASHFS_I(inode)->parent; } TRACE("Calling filldir(%p, %s, %d, %lld, %d, %d)\n", @@ -159,9 +159,9 @@ static int squashfs_readdir(struct file *file, void *dirent, filldir_t filldir) } length = get_dir_index_using_offset(inode->i_sb, &block, &offset, - SQUASHFS_I(inode)->dir_index_start, - SQUASHFS_I(inode)->dir_index_offset, - SQUASHFS_I(inode)->dir_index_count, + SQUASHFS_I(inode)->dir_idx_start, + SQUASHFS_I(inode)->dir_idx_offset, + SQUASHFS_I(inode)->dir_idx_cnt, file->f_pos); while (length < i_size_read(inode)) { diff --git a/kernel/fs/squashfs/export.c b/kernel/fs/squashfs/export.c index 8a40095..93b5e89 100644 --- a/kernel/fs/squashfs/export.c +++ b/kernel/fs/squashfs/export.c @@ -109,7 +109,7 @@ static struct dentry *squashfs_fh_to_parent(struct super_block *sb, static struct dentry *squashfs_get_parent(struct dentry *child) { struct inode *inode = child->d_inode; - unsigned int parent_ino = SQUASHFS_I(inode)->parent_inode; + unsigned int parent_ino = SQUASHFS_I(inode)->parent; return squashfs_export_iget(inode->i_sb, parent_ino); } diff --git a/kernel/fs/squashfs/file.c b/kernel/fs/squashfs/file.c index f25fd58..99679fa 100644 --- a/kernel/fs/squashfs/file.c +++ b/kernel/fs/squashfs/file.c @@ -246,7 +246,7 @@ static int fill_meta_index(struct inode *inode, int index, struct meta_entry *meta_entry; long long cur_index_block = SQUASHFS_I(inode)->block_list_start; int cur_offset = SQUASHFS_I(inode)->offset; - long long cur_data_block = SQUASHFS_I(inode)->start_block; + long long cur_data_block = SQUASHFS_I(inode)->start; int err, i; /* @@ -398,7 +398,7 @@ static int squashfs_readpage(struct file *file, struct page *page) int sparse = 0; TRACE("Entered squashfs_readpage, page index %lx, start block %llx\n", - page->index, SQUASHFS_I(inode)->start_block); + page->index, SQUASHFS_I(inode)->start); if (page->index >= ((i_size_read(inode) + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT)) diff --git a/kernel/fs/squashfs/inode.c b/kernel/fs/squashfs/inode.c index 4272c43..c532b88 100644 --- a/kernel/fs/squashfs/inode.c +++ b/kernel/fs/squashfs/inode.c @@ -53,23 +53,23 @@ * off disk. */ static int squashfs_new_inode(struct super_block *sb, struct inode *inode, - struct squashfs_base_inode *sino) + struct squashfs_base_inode *sqsh_ino) { int err; - err = squashfs_get_id(sb, le16_to_cpu(sino->uid), &inode->i_uid); + err = squashfs_get_id(sb, le16_to_cpu(sqsh_ino->uid), &inode->i_uid); if (err) goto out; - err = squashfs_get_id(sb, le16_to_cpu(sino->guid), &inode->i_gid); + err = squashfs_get_id(sb, le16_to_cpu(sqsh_ino->guid), &inode->i_gid); if (err) goto out; - inode->i_ino = le32_to_cpu(sino->inode_number); - inode->i_mtime.tv_sec = le32_to_cpu(sino->mtime); + inode->i_ino = le32_to_cpu(sqsh_ino->inode_number); + inode->i_mtime.tv_sec = le32_to_cpu(sqsh_ino->mtime); inode->i_atime.tv_sec = inode->i_mtime.tv_sec; inode->i_ctime.tv_sec = inode->i_mtime.tv_sec; - inode->i_mode = le16_to_cpu(sino->mode); + inode->i_mode = le16_to_cpu(sqsh_ino->mode); inode->i_size = 0; out: @@ -166,15 +166,14 @@ int squashfs_read_inode(struct inode *inode, long long ino) SQUASHFS_I(inode)->fragment_block = frag_blk; SQUASHFS_I(inode)->fragment_size = frag_size; SQUASHFS_I(inode)->fragment_offset = frag_offset; - SQUASHFS_I(inode)->start_block = - le32_to_cpu(sqsh_ino->start_block); + SQUASHFS_I(inode)->start = le32_to_cpu(sqsh_ino->start_block); SQUASHFS_I(inode)->block_list_start = block; SQUASHFS_I(inode)->offset = offset; inode->i_data.a_ops = &squashfs_aops; TRACE("File inode %x:%x, start_block %llx, block_list_start " "%llx, offset %x\n", SQUASHFS_INODE_BLK(ino), - offset, SQUASHFS_I(inode)->start_block, block, offset); + offset, SQUASHFS_I(inode)->start, block, offset); break; } case SQUASHFS_LREG_TYPE: { @@ -211,15 +210,14 @@ int squashfs_read_inode(struct inode *inode, long long ino) SQUASHFS_I(inode)->fragment_block = frag_blk; SQUASHFS_I(inode)->fragment_size = frag_size; SQUASHFS_I(inode)->fragment_offset = frag_offset; - SQUASHFS_I(inode)->start_block = - le64_to_cpu(sqsh_ino->start_block); + SQUASHFS_I(inode)->start = le64_to_cpu(sqsh_ino->start_block); SQUASHFS_I(inode)->block_list_start = block; SQUASHFS_I(inode)->offset = offset; inode->i_data.a_ops = &squashfs_aops; TRACE("File inode %x:%x, start_block %llx, block_list_start " "%llx, offset %x\n", SQUASHFS_INODE_BLK(ino), - offset, SQUASHFS_I(inode)->start_block, block, offset); + offset, SQUASHFS_I(inode)->start, block, offset); break; } case SQUASHFS_DIR_TYPE: { @@ -235,14 +233,14 @@ int squashfs_read_inode(struct inode *inode, long long ino) inode->i_op = &squashfs_dir_inode_ops; inode->i_fop = &squashfs_dir_ops; inode->i_mode |= S_IFDIR; - SQUASHFS_I(inode)->start_block = le32_to_cpu(sqsh_ino->start_block); + SQUASHFS_I(inode)->start = le32_to_cpu(sqsh_ino->start_block); SQUASHFS_I(inode)->offset = le16_to_cpu(sqsh_ino->offset); - SQUASHFS_I(inode)->dir_index_count = 0; - SQUASHFS_I(inode)->parent_inode = le32_to_cpu(sqsh_ino->parent_inode); + SQUASHFS_I(inode)->dir_idx_cnt = 0; + SQUASHFS_I(inode)->parent = le32_to_cpu(sqsh_ino->parent_inode); TRACE("Directory inode %x:%x, start_block %llx, offset %x\n", SQUASHFS_INODE_BLK(inode), offset, - SQUASHFS_I(i)->start_block, + SQUASHFS_I(i)->start, le16_to_cpu(sqsh_ino->offset)); break; } @@ -259,16 +257,16 @@ int squashfs_read_inode(struct inode *inode, long long ino) inode->i_op = &squashfs_dir_inode_ops; inode->i_fop = &squashfs_dir_ops; inode->i_mode |= S_IFDIR; - SQUASHFS_I(inode)->start_block = le32_to_cpu(sqsh_ino->start_block); + SQUASHFS_I(inode)->start = le32_to_cpu(sqsh_ino->start_block); SQUASHFS_I(inode)->offset = le16_to_cpu(sqsh_ino->offset); - SQUASHFS_I(inode)->dir_index_start = block; - SQUASHFS_I(inode)->dir_index_offset = offset; - SQUASHFS_I(inode)->dir_index_count = le16_to_cpu(sqsh_ino->i_count); - SQUASHFS_I(inode)->parent_inode = le32_to_cpu(sqsh_ino->parent_inode); + SQUASHFS_I(inode)->dir_idx_start = block; + SQUASHFS_I(inode)->dir_idx_offset = offset; + SQUASHFS_I(inode)->dir_idx_cnt = le16_to_cpu(sqsh_ino->i_count); + SQUASHFS_I(inode)->parent = le32_to_cpu(sqsh_ino->parent_inode); TRACE("Long directory inode %x:%x, start_block %llx, offset " "%x\n", SQUASHFS_INODE_BLK(ino), offset, - SQUASHFS_I(inode)->start_block, + SQUASHFS_I(inode)->start, le16_to_cpu(sqsh_ino->offset)); break; } @@ -285,7 +283,7 @@ int squashfs_read_inode(struct inode *inode, long long ino) inode->i_op = &page_symlink_inode_operations; inode->i_data.a_ops = &squashfs_symlink_aops; inode->i_mode |= S_IFLNK; - SQUASHFS_I(inode)->start_block = block; + SQUASHFS_I(inode)->start = block; SQUASHFS_I(inode)->offset = offset; TRACE("Symbolic link inode %x:%x, start_block %llx, offset " @@ -304,7 +302,8 @@ int squashfs_read_inode(struct inode *inode, long long ino) goto failed_read; inode->i_nlink = le32_to_cpu(sqsh_ino->nlink); - inode->i_mode |= (type == SQUASHFS_CHRDEV_TYPE) ? S_IFCHR : S_IFBLK; + 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)); @@ -323,7 +322,8 @@ int squashfs_read_inode(struct inode *inode, long long ino) goto failed_read; inode->i_nlink = le32_to_cpu(sqsh_ino->nlink); - inode->i_mode |= (type == SQUASHFS_FIFO_TYPE) ? S_IFIFO : S_IFSOCK; + inode->i_mode |= (type == SQUASHFS_FIFO_TYPE) + ? S_IFIFO : S_IFSOCK; init_special_inode(inode, le16_to_cpu(inode->i_mode), 0); break; } diff --git a/kernel/fs/squashfs/namei.c b/kernel/fs/squashfs/namei.c index c32ee6d..ba026de 100644 --- a/kernel/fs/squashfs/namei.c +++ b/kernel/fs/squashfs/namei.c @@ -141,8 +141,7 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, struct squashfs_sb_info *msblk = dir->i_sb->s_fs_info; struct squashfs_dir_header dirh; struct squashfs_dir_entry *dire; - long long block = SQUASHFS_I(dir)->start_block + - msblk->directory_table_start; + long long block = SQUASHFS_I(dir)->start + msblk->directory_table_start; int offset = SQUASHFS_I(dir)->offset; int err, length = 0, dir_count, size; @@ -161,9 +160,9 @@ static struct dentry *squashfs_lookup(struct inode *dir, struct dentry *dentry, } length = get_dir_index_using_name(dir->i_sb, &block, &offset, - SQUASHFS_I(dir)->dir_index_start, - SQUASHFS_I(dir)->dir_index_offset, - SQUASHFS_I(dir)->dir_index_count, name, len); + SQUASHFS_I(dir)->dir_idx_start, + SQUASHFS_I(dir)->dir_idx_offset, + SQUASHFS_I(dir)->dir_idx_cnt, name, len); while (length < i_size_read(dir)) { /* @@ -231,7 +230,7 @@ exit_lookup: read_failure: ERROR("Unable to read directory block [%llx:%x]\n", - SQUASHFS_I(dir)->start_block + msblk->directory_table_start, + SQUASHFS_I(dir)->start + msblk->directory_table_start, SQUASHFS_I(dir)->offset); failure: return ERR_PTR(err); diff --git a/kernel/fs/squashfs/symlink.c b/kernel/fs/squashfs/symlink.c index cc93005..df29aaf 100644 --- a/kernel/fs/squashfs/symlink.c +++ b/kernel/fs/squashfs/symlink.c @@ -49,7 +49,7 @@ static int squashfs_symlink_readpage(struct file *file, struct page *page) struct super_block *sb = inode->i_sb; struct squashfs_sb_info *msblk = sb->s_fs_info; int index = page->index << PAGE_CACHE_SHIFT; - long long block = SQUASHFS_I(inode)->start_block; + long long block = SQUASHFS_I(inode)->start; int offset = SQUASHFS_I(inode)->offset; int length = min_t(int, i_size_read(inode) - index, PAGE_CACHE_SIZE); int avail, bytes; @@ -67,7 +67,7 @@ static int squashfs_symlink_readpage(struct file *file, struct page *page) index); if (bytes < 0) { ERROR("Unable to read symlink [%llx:%x]\n", - SQUASHFS_I(inode)->start_block, + SQUASHFS_I(inode)->start, SQUASHFS_I(inode)->offset); goto error_out; } @@ -86,7 +86,7 @@ static int squashfs_symlink_readpage(struct file *file, struct page *page) if (entry->error) { ERROR("Unable to read symlink [%llx:%x]\n", - SQUASHFS_I(inode)->start_block, + SQUASHFS_I(inode)->start, SQUASHFS_I(inode)->offset); squashfs_cache_put(msblk->block_cache, entry); goto error_out; diff --git a/kernel/include/linux/squashfs_fs_i.h b/kernel/include/linux/squashfs_fs_i.h index b8abd56..d520d16 100644 --- a/kernel/include/linux/squashfs_fs_i.h +++ b/kernel/include/linux/squashfs_fs_i.h @@ -24,7 +24,7 @@ */ struct squashfs_inode_info { - long long start_block; + long long start; unsigned int offset; union { struct { @@ -34,10 +34,10 @@ struct squashfs_inode_info { long long block_list_start; }; struct { - long long dir_index_start; - unsigned int dir_index_offset; - unsigned int dir_index_count; - unsigned int parent_inode; + long long dir_idx_start; + unsigned int dir_idx_offset; + unsigned int dir_idx_cnt; + unsigned int parent; }; }; struct inode vfs_inode; |