Commit af5bc92d authored by Theodore Ts'o's avatar Theodore Ts'o

ext4: Fix whitespace checkpatch warnings/errors

Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent e5f8eab8
...@@ -58,9 +58,9 @@ static inline int ext4_acl_count(size_t size) ...@@ -58,9 +58,9 @@ static inline int ext4_acl_count(size_t size)
#define EXT4_ACL_NOT_CACHED ((void *)-1) #define EXT4_ACL_NOT_CACHED ((void *)-1)
/* acl.c */ /* acl.c */
extern int ext4_permission (struct inode *, int); extern int ext4_permission(struct inode *, int);
extern int ext4_acl_chmod (struct inode *); extern int ext4_acl_chmod(struct inode *);
extern int ext4_init_acl (handle_t *, struct inode *, struct inode *); extern int ext4_init_acl(handle_t *, struct inode *, struct inode *);
#else /* CONFIG_EXT4DEV_FS_POSIX_ACL */ #else /* CONFIG_EXT4DEV_FS_POSIX_ACL */
#include <linux/sched.h> #include <linux/sched.h>
......
...@@ -132,7 +132,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, ...@@ -132,7 +132,7 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
*/ */
group_blocks = ext4_blocks_count(sbi->s_es) - group_blocks = ext4_blocks_count(sbi->s_es) -
le32_to_cpu(sbi->s_es->s_first_data_block) - le32_to_cpu(sbi->s_es->s_first_data_block) -
(EXT4_BLOCKS_PER_GROUP(sb) * (sbi->s_groups_count -1)); (EXT4_BLOCKS_PER_GROUP(sb) * (sbi->s_groups_count - 1));
} else { } else {
group_blocks = EXT4_BLOCKS_PER_GROUP(sb); group_blocks = EXT4_BLOCKS_PER_GROUP(sb);
} }
...@@ -200,20 +200,20 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh, ...@@ -200,20 +200,20 @@ unsigned ext4_init_block_bitmap(struct super_block *sb, struct buffer_head *bh,
* @bh: pointer to the buffer head to store the block * @bh: pointer to the buffer head to store the block
* group descriptor * group descriptor
*/ */
struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, struct ext4_group_desc * ext4_get_group_desc(struct super_block *sb,
ext4_group_t block_group, ext4_group_t block_group,
struct buffer_head ** bh) struct buffer_head **bh)
{ {
unsigned long group_desc; unsigned long group_desc;
unsigned long offset; unsigned long offset;
struct ext4_group_desc * desc; struct ext4_group_desc *desc;
struct ext4_sb_info *sbi = EXT4_SB(sb); struct ext4_sb_info *sbi = EXT4_SB(sb);
if (block_group >= sbi->s_groups_count) { if (block_group >= sbi->s_groups_count) {
ext4_error (sb, "ext4_get_group_desc", ext4_error(sb, "ext4_get_group_desc",
"block_group >= groups_count - " "block_group >= groups_count - "
"block_group = %lu, groups_count = %lu", "block_group = %lu, groups_count = %lu",
block_group, sbi->s_groups_count); block_group, sbi->s_groups_count);
return NULL; return NULL;
} }
...@@ -222,10 +222,10 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, ...@@ -222,10 +222,10 @@ struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
group_desc = block_group >> EXT4_DESC_PER_BLOCK_BITS(sb); group_desc = block_group >> EXT4_DESC_PER_BLOCK_BITS(sb);
offset = block_group & (EXT4_DESC_PER_BLOCK(sb) - 1); offset = block_group & (EXT4_DESC_PER_BLOCK(sb) - 1);
if (!sbi->s_group_desc[group_desc]) { if (!sbi->s_group_desc[group_desc]) {
ext4_error (sb, "ext4_get_group_desc", ext4_error(sb, "ext4_get_group_desc",
"Group descriptor not loaded - " "Group descriptor not loaded - "
"block_group = %lu, group_desc = %lu, desc = %lu", "block_group = %lu, group_desc = %lu, desc = %lu",
block_group, group_desc, offset); block_group, group_desc, offset);
return NULL; return NULL;
} }
...@@ -302,8 +302,8 @@ static int ext4_valid_block_bitmap(struct super_block *sb, ...@@ -302,8 +302,8 @@ static int ext4_valid_block_bitmap(struct super_block *sb,
struct buffer_head * struct buffer_head *
ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group) ext4_read_block_bitmap(struct super_block *sb, ext4_group_t block_group)
{ {
struct ext4_group_desc * desc; struct ext4_group_desc *desc;
struct buffer_head * bh = NULL; struct buffer_head *bh = NULL;
ext4_fsblk_t bitmap_blk; ext4_fsblk_t bitmap_blk;
desc = ext4_get_group_desc(sb, block_group, NULL); desc = ext4_get_group_desc(sb, block_group, NULL);
...@@ -506,8 +506,8 @@ void ext4_rsv_window_add(struct super_block *sb, ...@@ -506,8 +506,8 @@ void ext4_rsv_window_add(struct super_block *sb,
struct rb_node *node = &rsv->rsv_node; struct rb_node *node = &rsv->rsv_node;
ext4_fsblk_t start = rsv->rsv_start; ext4_fsblk_t start = rsv->rsv_start;
struct rb_node ** p = &root->rb_node; struct rb_node **p = &root->rb_node;
struct rb_node * parent = NULL; struct rb_node *parent = NULL;
struct ext4_reserve_window_node *this; struct ext4_reserve_window_node *this;
while (*p) while (*p)
...@@ -661,8 +661,8 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -661,8 +661,8 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
ext4_grpblk_t bit; ext4_grpblk_t bit;
unsigned long i; unsigned long i;
unsigned long overflow; unsigned long overflow;
struct ext4_group_desc * desc; struct ext4_group_desc *desc;
struct ext4_super_block * es; struct ext4_super_block *es;
struct ext4_sb_info *sbi; struct ext4_sb_info *sbi;
int err = 0, ret; int err = 0, ret;
ext4_grpblk_t group_freed; ext4_grpblk_t group_freed;
...@@ -673,13 +673,13 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -673,13 +673,13 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
if (block < le32_to_cpu(es->s_first_data_block) || if (block < le32_to_cpu(es->s_first_data_block) ||
block + count < block || block + count < block ||
block + count > ext4_blocks_count(es)) { block + count > ext4_blocks_count(es)) {
ext4_error (sb, "ext4_free_blocks", ext4_error(sb, "ext4_free_blocks",
"Freeing blocks not in datazone - " "Freeing blocks not in datazone - "
"block = %llu, count = %lu", block, count); "block = %llu, count = %lu", block, count);
goto error_return; goto error_return;
} }
ext4_debug ("freeing block(s) %llu-%llu\n", block, block + count - 1); ext4_debug("freeing block(s) %llu-%llu\n", block, block + count - 1);
do_more: do_more:
overflow = 0; overflow = 0;
...@@ -696,7 +696,7 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -696,7 +696,7 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
bitmap_bh = ext4_read_block_bitmap(sb, block_group); bitmap_bh = ext4_read_block_bitmap(sb, block_group);
if (!bitmap_bh) if (!bitmap_bh)
goto error_return; goto error_return;
desc = ext4_get_group_desc (sb, block_group, &gd_bh); desc = ext4_get_group_desc(sb, block_group, &gd_bh);
if (!desc) if (!desc)
goto error_return; goto error_return;
...@@ -705,10 +705,10 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb, ...@@ -705,10 +705,10 @@ void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) || in_range(block, ext4_inode_table(sb, desc), sbi->s_itb_per_group) ||
in_range(block + count - 1, ext4_inode_table(sb, desc), in_range(block + count - 1, ext4_inode_table(sb, desc),
sbi->s_itb_per_group)) { sbi->s_itb_per_group)) {
ext4_error (sb, "ext4_free_blocks", ext4_error(sb, "ext4_free_blocks",
"Freeing blocks in system zones - " "Freeing blocks in system zones - "
"Block = %llu, count = %lu", "Block = %llu, count = %lu",
block, count); block, count);
goto error_return; goto error_return;
} }
...@@ -850,7 +850,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode, ...@@ -850,7 +850,7 @@ void ext4_free_blocks(handle_t *handle, struct inode *inode,
ext4_fsblk_t block, unsigned long count, ext4_fsblk_t block, unsigned long count,
int metadata) int metadata)
{ {
struct super_block * sb; struct super_block *sb;
unsigned long dquot_freed_blocks; unsigned long dquot_freed_blocks;
/* this isn't the right place to decide whether block is metadata /* this isn't the right place to decide whether block is metadata
...@@ -1019,7 +1019,7 @@ claim_block(spinlock_t *lock, ext4_grpblk_t block, struct buffer_head *bh) ...@@ -1019,7 +1019,7 @@ claim_block(spinlock_t *lock, ext4_grpblk_t block, struct buffer_head *bh)
if (ext4_set_bit_atomic(lock, block, bh->b_data)) if (ext4_set_bit_atomic(lock, block, bh->b_data))
return 0; return 0;
jbd_lock_bh_state(bh); jbd_lock_bh_state(bh);
if (jh->b_committed_data && ext4_test_bit(block,jh->b_committed_data)) { if (jh->b_committed_data && ext4_test_bit(block, jh->b_committed_data)) {
ext4_clear_bit_atomic(lock, block, bh->b_data); ext4_clear_bit_atomic(lock, block, bh->b_data);
ret = 0; ret = 0;
} else { } else {
...@@ -1170,7 +1170,7 @@ ext4_try_to_allocate(struct super_block *sb, handle_t *handle, ...@@ -1170,7 +1170,7 @@ ext4_try_to_allocate(struct super_block *sb, handle_t *handle,
static int find_next_reservable_window( static int find_next_reservable_window(
struct ext4_reserve_window_node *search_head, struct ext4_reserve_window_node *search_head,
struct ext4_reserve_window_node *my_rsv, struct ext4_reserve_window_node *my_rsv,
struct super_block * sb, struct super_block *sb,
ext4_fsblk_t start_block, ext4_fsblk_t start_block,
ext4_fsblk_t last_block) ext4_fsblk_t last_block)
{ {
...@@ -1204,7 +1204,7 @@ static int find_next_reservable_window( ...@@ -1204,7 +1204,7 @@ static int find_next_reservable_window(
prev = rsv; prev = rsv;
next = rb_next(&rsv->rsv_node); next = rb_next(&rsv->rsv_node);
rsv = rb_entry(next,struct ext4_reserve_window_node,rsv_node); rsv = rb_entry(next, struct ext4_reserve_window_node, rsv_node);
/* /*
* Reached the last reservation, we can just append to the * Reached the last reservation, we can just append to the
...@@ -1342,7 +1342,7 @@ static int alloc_new_reservation(struct ext4_reserve_window_node *my_rsv, ...@@ -1342,7 +1342,7 @@ static int alloc_new_reservation(struct ext4_reserve_window_node *my_rsv,
size = size * 2; size = size * 2;
if (size > EXT4_MAX_RESERVE_BLOCKS) if (size > EXT4_MAX_RESERVE_BLOCKS)
size = EXT4_MAX_RESERVE_BLOCKS; size = EXT4_MAX_RESERVE_BLOCKS;
my_rsv->rsv_goal_size= size; my_rsv->rsv_goal_size = size;
} }
} }
...@@ -1491,7 +1491,7 @@ static ext4_grpblk_t ...@@ -1491,7 +1491,7 @@ static ext4_grpblk_t
ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle, ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
ext4_group_t group, struct buffer_head *bitmap_bh, ext4_group_t group, struct buffer_head *bitmap_bh,
ext4_grpblk_t grp_goal, ext4_grpblk_t grp_goal,
struct ext4_reserve_window_node * my_rsv, struct ext4_reserve_window_node *my_rsv,
unsigned long *count, int *errp) unsigned long *count, int *errp)
{ {
ext4_fsblk_t group_first_block, group_last_block; ext4_fsblk_t group_first_block, group_last_block;
...@@ -1519,7 +1519,7 @@ ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle, ...@@ -1519,7 +1519,7 @@ ext4_try_to_allocate_with_rsv(struct super_block *sb, handle_t *handle,
* or the file is not a regular file * or the file is not a regular file
* or last attempt to allocate a block with reservation turned on failed * or last attempt to allocate a block with reservation turned on failed
*/ */
if (my_rsv == NULL ) { if (my_rsv == NULL) {
ret = ext4_try_to_allocate(sb, handle, group, bitmap_bh, ret = ext4_try_to_allocate(sb, handle, group, bitmap_bh,
grp_goal, count, NULL); grp_goal, count, NULL);
goto out; goto out;
...@@ -2184,7 +2184,7 @@ unsigned long ext4_bg_num_gdb(struct super_block *sb, ext4_group_t group) ...@@ -2184,7 +2184,7 @@ unsigned long ext4_bg_num_gdb(struct super_block *sb, ext4_group_t group)
if (!EXT4_HAS_INCOMPAT_FEATURE(sb,EXT4_FEATURE_INCOMPAT_META_BG) || if (!EXT4_HAS_INCOMPAT_FEATURE(sb,EXT4_FEATURE_INCOMPAT_META_BG) ||
metagroup < first_meta_bg) metagroup < first_meta_bg)
return ext4_bg_num_gdb_nometa(sb,group); return ext4_bg_num_gdb_nometa(sb, group);
return ext4_bg_num_gdb_meta(sb,group); return ext4_bg_num_gdb_meta(sb,group);
......
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0}; static const int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};
unsigned long ext4_count_free (struct buffer_head * map, unsigned int numchars) unsigned long ext4_count_free(struct buffer_head *map, unsigned int numchars)
{ {
unsigned int i; unsigned int i;
unsigned long sum = 0; unsigned long sum = 0;
if (!map) if (!map)
return (0); return 0;
for (i = 0; i < numchars; i++) for (i = 0; i < numchars; i++)
sum += nibblemap[map->b_data[i] & 0xf] + sum += nibblemap[map->b_data[i] & 0xf] +
nibblemap[(map->b_data[i] >> 4) & 0xf]; nibblemap[(map->b_data[i] >> 4) & 0xf];
return (sum); return sum;
} }
#endif /* EXT4FS_DEBUG */ #endif /* EXT4FS_DEBUG */
......
...@@ -33,10 +33,10 @@ static unsigned char ext4_filetype_table[] = { ...@@ -33,10 +33,10 @@ static unsigned char ext4_filetype_table[] = {
}; };
static int ext4_readdir(struct file *, void *, filldir_t); static int ext4_readdir(struct file *, void *, filldir_t);
static int ext4_dx_readdir(struct file * filp, static int ext4_dx_readdir(struct file *filp,
void * dirent, filldir_t filldir); void *dirent, filldir_t filldir);
static int ext4_release_dir (struct inode * inode, static int ext4_release_dir(struct inode *inode,
struct file * filp); struct file *filp);
const struct file_operations ext4_dir_operations = { const struct file_operations ext4_dir_operations = {
.llseek = generic_file_llseek, .llseek = generic_file_llseek,
...@@ -61,12 +61,12 @@ static unsigned char get_dtype(struct super_block *sb, int filetype) ...@@ -61,12 +61,12 @@ static unsigned char get_dtype(struct super_block *sb, int filetype)
} }
int ext4_check_dir_entry (const char * function, struct inode * dir, int ext4_check_dir_entry(const char *function, struct inode *dir,
struct ext4_dir_entry_2 * de, struct ext4_dir_entry_2 *de,
struct buffer_head * bh, struct buffer_head *bh,
unsigned long offset) unsigned long offset)
{ {
const char * error_msg = NULL; const char *error_msg = NULL;
const int rlen = ext4_rec_len_from_disk(de->rec_len); const int rlen = ext4_rec_len_from_disk(de->rec_len);
if (rlen < EXT4_DIR_REC_LEN(1)) if (rlen < EXT4_DIR_REC_LEN(1))
...@@ -82,7 +82,7 @@ int ext4_check_dir_entry (const char * function, struct inode * dir, ...@@ -82,7 +82,7 @@ int ext4_check_dir_entry (const char * function, struct inode * dir,
error_msg = "inode out of bounds"; error_msg = "inode out of bounds";
if (error_msg != NULL) if (error_msg != NULL)
ext4_error (dir->i_sb, function, ext4_error(dir->i_sb, function,
"bad entry in directory #%lu: %s - " "bad entry in directory #%lu: %s - "
"offset=%lu, inode=%lu, rec_len=%d, name_len=%d", "offset=%lu, inode=%lu, rec_len=%d, name_len=%d",
dir->i_ino, error_msg, offset, dir->i_ino, error_msg, offset,
...@@ -91,8 +91,8 @@ int ext4_check_dir_entry (const char * function, struct inode * dir, ...@@ -91,8 +91,8 @@ int ext4_check_dir_entry (const char * function, struct inode * dir,
return error_msg == NULL ? 1 : 0; return error_msg == NULL ? 1 : 0;
} }
static int ext4_readdir(struct file * filp, static int ext4_readdir(struct file *filp,
void * dirent, filldir_t filldir) void *dirent, filldir_t filldir)
{ {
int error = 0; int error = 0;
unsigned long offset; unsigned long offset;
...@@ -148,7 +148,7 @@ static int ext4_readdir(struct file * filp, ...@@ -148,7 +148,7 @@ static int ext4_readdir(struct file * filp,
* of recovering data when there's a bad sector * of recovering data when there's a bad sector
*/ */
if (!bh) { if (!bh) {
ext4_error (sb, "ext4_readdir", ext4_error(sb, "ext4_readdir",
"directory #%lu contains a hole at offset %lu", "directory #%lu contains a hole at offset %lu",
inode->i_ino, (unsigned long)filp->f_pos); inode->i_ino, (unsigned long)filp->f_pos);
/* corrupt size? Maybe no more blocks to read */ /* corrupt size? Maybe no more blocks to read */
...@@ -187,14 +187,14 @@ static int ext4_readdir(struct file * filp, ...@@ -187,14 +187,14 @@ static int ext4_readdir(struct file * filp,
while (!error && filp->f_pos < inode->i_size while (!error && filp->f_pos < inode->i_size
&& offset < sb->s_blocksize) { && offset < sb->s_blocksize) {
de = (struct ext4_dir_entry_2 *) (bh->b_data + offset); de = (struct ext4_dir_entry_2 *) (bh->b_data + offset);
if (!ext4_check_dir_entry ("ext4_readdir", inode, de, if (!ext4_check_dir_entry("ext4_readdir", inode, de,
bh, offset)) { bh, offset)) {
/* /*
* On error, skip the f_pos to the next block * On error, skip the f_pos to the next block
*/ */
filp->f_pos = (filp->f_pos | filp->f_pos = (filp->f_pos |
(sb->s_blocksize - 1)) + 1; (sb->s_blocksize - 1)) + 1;
brelse (bh); brelse(bh);
ret = stored; ret = stored;
goto out; goto out;
} }
...@@ -218,12 +218,12 @@ static int ext4_readdir(struct file * filp, ...@@ -218,12 +218,12 @@ static int ext4_readdir(struct file * filp,
break; break;
if (version != filp->f_version) if (version != filp->f_version)
goto revalidate; goto revalidate;
stored ++; stored++;
} }
filp->f_pos += ext4_rec_len_from_disk(de->rec_len); filp->f_pos += ext4_rec_len_from_disk(de->rec_len);
} }
offset = 0; offset = 0;
brelse (bh); brelse(bh);
} }
out: out:
return ret; return ret;
...@@ -290,9 +290,9 @@ static void free_rb_tree_fname(struct rb_root *root) ...@@ -290,9 +290,9 @@ static void free_rb_tree_fname(struct rb_root *root)
parent = rb_parent(n); parent = rb_parent(n);
fname = rb_entry(n, struct fname, rb_hash); fname = rb_entry(n, struct fname, rb_hash);
while (fname) { while (fname) {
struct fname * old = fname; struct fname *old = fname;
fname = fname->next; fname = fname->next;
kfree (old); kfree(old);
} }
if (!parent) if (!parent)
root->rb_node = NULL; root->rb_node = NULL;
...@@ -331,7 +331,7 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, ...@@ -331,7 +331,7 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
struct ext4_dir_entry_2 *dirent) struct ext4_dir_entry_2 *dirent)
{ {
struct rb_node **p, *parent = NULL; struct rb_node **p, *parent = NULL;
struct fname * fname, *new_fn; struct fname *fname, *new_fn;
struct dir_private_info *info; struct dir_private_info *info;
int len; int len;
...@@ -388,13 +388,13 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, ...@@ -388,13 +388,13 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
* for all entres on the fname linked list. (Normally there is only * for all entres on the fname linked list. (Normally there is only
* one entry on the linked list, unless there are 62 bit hash collisions.) * one entry on the linked list, unless there are 62 bit hash collisions.)
*/ */
static int call_filldir(struct file * filp, void * dirent, static int call_filldir(struct file *filp, void *dirent,
filldir_t filldir, struct fname *fname) filldir_t filldir, struct fname *fname)
{ {
struct dir_private_info *info = filp->private_data; struct dir_private_info *info = filp->private_data;
loff_t curr_pos; loff_t curr_pos;
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
struct super_block * sb; struct super_block *sb;
int error; int error;
sb = inode->i_sb; sb = inode->i_sb;
...@@ -420,8 +420,8 @@ static int call_filldir(struct file * filp, void * dirent, ...@@ -420,8 +420,8 @@ static int call_filldir(struct file * filp, void * dirent,
return 0; return 0;
} }
static int ext4_dx_readdir(struct file * filp, static int ext4_dx_readdir(struct file *filp,
void * dirent, filldir_t filldir) void *dirent, filldir_t filldir)
{ {
struct dir_private_info *info = filp->private_data; struct dir_private_info *info = filp->private_data;
struct inode *inode = filp->f_path.dentry->d_inode; struct inode *inode = filp->f_path.dentry->d_inode;
...@@ -512,7 +512,7 @@ static int ext4_dx_readdir(struct file * filp, ...@@ -512,7 +512,7 @@ static int ext4_dx_readdir(struct file * filp,
return 0; return 0;
} }
static int ext4_release_dir (struct inode * inode, struct file * filp) static int ext4_release_dir(struct inode *inode, struct file *filp)
{ {
if (filp->private_data) if (filp->private_data)
ext4_htree_free_dir_info(filp->private_data); ext4_htree_free_dir_info(filp->private_data);
......
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
#ifdef EXT4FS_DEBUG #ifdef EXT4FS_DEBUG
#define ext4_debug(f, a...) \ #define ext4_debug(f, a...) \
do { \ do { \
printk (KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \ printk(KERN_DEBUG "EXT4-fs DEBUG (%s, %d): %s:", \
__FILE__, __LINE__, __func__); \ __FILE__, __LINE__, __func__); \
printk (KERN_DEBUG f, ## a); \ printk(KERN_DEBUG f, ## a); \
} while (0) } while (0)
#else #else
#define ext4_debug(f, a...) do {} while (0) #define ext4_debug(f, a...) do {} while (0)
...@@ -128,7 +128,7 @@ struct ext4_allocation_request { ...@@ -128,7 +128,7 @@ struct ext4_allocation_request {
#else #else
# define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size) # define EXT4_BLOCK_SIZE(s) (EXT4_MIN_BLOCK_SIZE << (s)->s_log_block_size)
#endif #endif
#define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof (__u32)) #define EXT4_ADDR_PER_BLOCK(s) (EXT4_BLOCK_SIZE(s) / sizeof(__u32))
#ifdef __KERNEL__ #ifdef __KERNEL__
# define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits) # define EXT4_BLOCK_SIZE_BITS(s) ((s)->s_blocksize_bits)
#else #else
...@@ -292,7 +292,7 @@ struct ext4_new_group_data { ...@@ -292,7 +292,7 @@ struct ext4_new_group_data {
#define EXT4_IOC_GETVERSION _IOR('f', 3, long) #define EXT4_IOC_GETVERSION _IOR('f', 3, long)
#define EXT4_IOC_SETVERSION _IOW('f', 4, long) #define EXT4_IOC_SETVERSION _IOW('f', 4, long)
#define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) #define EXT4_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long)
#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) #define EXT4_IOC_GROUP_ADD _IOW('f', 8, struct ext4_new_group_input)
#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION #define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION #define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
#ifdef CONFIG_JBD2_DEBUG #ifdef CONFIG_JBD2_DEBUG
...@@ -667,7 +667,7 @@ struct ext4_super_block { ...@@ -667,7 +667,7 @@ struct ext4_super_block {
}; };
#ifdef __KERNEL__ #ifdef __KERNEL__
static inline struct ext4_sb_info * EXT4_SB(struct super_block *sb) static inline struct ext4_sb_info *EXT4_SB(struct super_block *sb)
{ {
return sb->s_fs_info; return sb->s_fs_info;
} }
...@@ -725,11 +725,11 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) ...@@ -725,11 +725,11 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
*/ */
#define EXT4_HAS_COMPAT_FEATURE(sb,mask) \ #define EXT4_HAS_COMPAT_FEATURE(sb,mask) \
( EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask) ) (EXT4_SB(sb)->s_es->s_feature_compat & cpu_to_le32(mask))
#define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \ #define EXT4_HAS_RO_COMPAT_FEATURE(sb,mask) \
( EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask) ) (EXT4_SB(sb)->s_es->s_feature_ro_compat & cpu_to_le32(mask))
#define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \ #define EXT4_HAS_INCOMPAT_FEATURE(sb,mask) \
( EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask) ) (EXT4_SB(sb)->s_es->s_feature_incompat & cpu_to_le32(mask))
#define EXT4_SET_COMPAT_FEATURE(sb,mask) \ #define EXT4_SET_COMPAT_FEATURE(sb,mask) \
EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask) EXT4_SB(sb)->s_es->s_feature_compat |= cpu_to_le32(mask)
#define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \ #define EXT4_SET_RO_COMPAT_FEATURE(sb,mask) \
...@@ -985,13 +985,13 @@ extern ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode, ...@@ -985,13 +985,13 @@ extern ext4_fsblk_t ext4_old_new_blocks(handle_t *handle, struct inode *inode,
ext4_fsblk_t goal, unsigned long *count, int *errp); ext4_fsblk_t goal, unsigned long *count, int *errp);
extern ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi, extern ext4_fsblk_t ext4_has_free_blocks(struct ext4_sb_info *sbi,
ext4_fsblk_t nblocks); ext4_fsblk_t nblocks);
extern void ext4_free_blocks (handle_t *handle, struct inode *inode, extern void ext4_free_blocks(handle_t *handle, struct inode *inode,
ext4_fsblk_t block, unsigned long count, int metadata); ext4_fsblk_t block, unsigned long count, int metadata);
extern void ext4_free_blocks_sb (handle_t *handle, struct super_block *sb, extern void ext4_free_blocks_sb(handle_t *handle, struct super_block *sb,
ext4_fsblk_t block, unsigned long count, ext4_fsblk_t block, unsigned long count,
unsigned long *pdquot_freed_blocks); unsigned long *pdquot_freed_blocks);
extern ext4_fsblk_t ext4_count_free_blocks (struct super_block *); extern ext4_fsblk_t ext4_count_free_blocks(struct super_block *);
extern void ext4_check_blocks_bitmap (struct super_block *); extern void ext4_check_blocks_bitmap(struct super_block *);
extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb, extern struct ext4_group_desc * ext4_get_group_desc(struct super_block * sb,
ext4_group_t block_group, ext4_group_t block_group,
struct buffer_head ** bh); struct buffer_head ** bh);
...@@ -1009,20 +1009,20 @@ extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash, ...@@ -1009,20 +1009,20 @@ extern int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
extern void ext4_htree_free_dir_info(struct dir_private_info *p); extern void ext4_htree_free_dir_info(struct dir_private_info *p);
/* fsync.c */ /* fsync.c */
extern int ext4_sync_file (struct file *, struct dentry *, int); extern int ext4_sync_file(struct file *, struct dentry *, int);
/* hash.c */ /* hash.c */
extern int ext4fs_dirhash(const char *name, int len, struct extern int ext4fs_dirhash(const char *name, int len, struct
dx_hash_info *hinfo); dx_hash_info *hinfo);
/* ialloc.c */ /* ialloc.c */
extern struct inode * ext4_new_inode (handle_t *, struct inode *, int); extern struct inode * ext4_new_inode(handle_t *, struct inode *, int);
extern void ext4_free_inode (handle_t *, struct inode *); extern void ext4_free_inode(handle_t *, struct inode *);
extern struct inode * ext4_orphan_get (struct super_block *, unsigned long); extern struct inode * ext4_orphan_get(struct super_block *, unsigned long);
extern unsigned long ext4_count_free_inodes (struct super_block *); extern unsigned long ext4_count_free_inodes(struct super_block *);
extern unsigned long ext4_count_dirs (struct super_block *); extern unsigned long ext4_count_dirs(struct super_block *);
extern void ext4_check_inodes_bitmap (struct super_block *); extern void ext4_check_inodes_bitmap(struct super_block *);
extern unsigned long ext4_count_free (struct buffer_head *, unsigned); extern unsigned long ext4_count_free(struct buffer_head *, unsigned);
/* mballoc.c */ /* mballoc.c */
extern long ext4_mb_stats; extern long ext4_mb_stats;
...@@ -1056,18 +1056,18 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode, ...@@ -1056,18 +1056,18 @@ int ext4_get_blocks_handle(handle_t *handle, struct inode *inode,
int create, int extend_disksize); int create, int extend_disksize);
extern struct inode *ext4_iget(struct super_block *, unsigned long); extern struct inode *ext4_iget(struct super_block *, unsigned long);
extern int ext4_write_inode (struct inode *, int); extern int ext4_write_inode(struct inode *, int);
extern int ext4_setattr (struct dentry *, struct iattr *); extern int ext4_setattr(struct dentry *, struct iattr *);
extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry, extern int ext4_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct kstat *stat); struct kstat *stat);
extern void ext4_delete_inode (struct inode *); extern void ext4_delete_inode(struct inode *);
extern int ext4_sync_inode (handle_t *, struct inode *); extern int ext4_sync_inode(handle_t *, struct inode *);
extern void ext4_discard_reservation (struct inode *); extern void ext4_discard_reservation(struct inode *);
extern void ext4_dirty_inode(struct inode *); extern void ext4_dirty_inode(struct inode *);
extern int ext4_change_inode_journal_flag(struct inode *, int); extern int ext4_change_inode_journal_flag(struct inode *, int);
extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
extern int ext4_can_truncate(struct inode *inode); extern int ext4_can_truncate(struct inode *inode);
extern void ext4_truncate (struct inode *); extern void ext4_truncate(struct inode *);
extern void ext4_set_inode_flags(struct inode *); extern void ext4_set_inode_flags(struct inode *);
extern void ext4_get_inode_flags(struct ext4_inode_info *); extern void ext4_get_inode_flags(struct ext4_inode_info *);
extern void ext4_set_aops(struct inode *inode); extern void ext4_set_aops(struct inode *inode);
...@@ -1080,7 +1080,7 @@ extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct page *page); ...@@ -1080,7 +1080,7 @@ extern int ext4_page_mkwrite(struct vm_area_struct *vma, struct page *page);
/* ioctl.c */ /* ioctl.c */
extern long ext4_ioctl(struct file *, unsigned int, unsigned long); extern long ext4_ioctl(struct file *, unsigned int, unsigned long);
extern long ext4_compat_ioctl (struct file *, unsigned int, unsigned long); extern long ext4_compat_ioctl(struct file *, unsigned int, unsigned long);
/* migrate.c */ /* migrate.c */
extern int ext4_ext_migrate(struct inode *, struct file *, unsigned int, extern int ext4_ext_migrate(struct inode *, struct file *, unsigned int,
...@@ -1099,14 +1099,14 @@ extern int ext4_group_extend(struct super_block *sb, ...@@ -1099,14 +1099,14 @@ extern int ext4_group_extend(struct super_block *sb,
ext4_fsblk_t n_blocks_count); ext4_fsblk_t n_blocks_count);
/* super.c */ /* super.c */
extern void ext4_error (struct super_block *, const char *, const char *, ...) extern void ext4_error(struct super_block *, const char *, const char *, ...)
__attribute__ ((format (printf, 3, 4))); __attribute__ ((format (printf, 3, 4)));
extern void __ext4_std_error (struct super_block *, const char *, int); extern void __ext4_std_error(struct super_block *, const char *, int);
extern void ext4_abort (struct super_block *, const char *, const char *, ...) extern void ext4_abort(struct super_block *, const char *, const char *, ...)
__attribute__ ((format (printf, 3, 4))); __attribute__ ((format (printf, 3, 4)));
extern void ext4_warning (struct super_block *, const char *, const char *, ...) extern void ext4_warning(struct super_block *, const char *, const char *, ...)
__attribute__ ((format (printf, 3, 4))); __attribute__ ((format (printf, 3, 4)));
extern void ext4_update_dynamic_rev (struct super_block *sb); extern void ext4_update_dynamic_rev(struct super_block *sb);
extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb, extern int ext4_update_compat_feature(handle_t *handle, struct super_block *sb,
__u32 compat); __u32 compat);
extern int ext4_update_rocompat_feature(handle_t *handle, extern int ext4_update_rocompat_feature(handle_t *handle,
...@@ -1179,7 +1179,7 @@ static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size) ...@@ -1179,7 +1179,7 @@ static inline void ext4_isize_set(struct ext4_inode *raw_inode, loff_t i_size)
static inline static inline
struct ext4_group_info *ext4_get_group_info(struct super_block *sb, struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
ext4_group_t group) ext4_group_t group)
{ {
struct ext4_group_info ***grp_info; struct ext4_group_info ***grp_info;
long indexv, indexh; long indexv, indexh;
......
...@@ -40,8 +40,8 @@ struct ext4_sb_info { ...@@ -40,8 +40,8 @@ struct ext4_sb_info {
unsigned long s_blocks_last; /* Last seen block count */ unsigned long s_blocks_last; /* Last seen block count */
loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */ loff_t s_bitmap_maxbytes; /* max bytes for bitmap files */
struct buffer_head * s_sbh; /* Buffer containing the super block */ struct buffer_head * s_sbh; /* Buffer containing the super block */
struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ struct ext4_super_block *s_es; /* Pointer to the super block in the buffer */
struct buffer_head ** s_group_desc; struct buffer_head **s_group_desc;
unsigned long s_mount_opt; unsigned long s_mount_opt;
ext4_fsblk_t s_sb_block; ext4_fsblk_t s_sb_block;
uid_t s_resuid; uid_t s_resuid;
...@@ -67,8 +67,8 @@ struct ext4_sb_info { ...@@ -67,8 +67,8 @@ struct ext4_sb_info {
struct ext4_reserve_window_node s_rsv_window_head; struct ext4_reserve_window_node s_rsv_window_head;
/* Journaling */ /* Journaling */
struct inode * s_journal_inode; struct inode *s_journal_inode;
struct journal_s * s_journal; struct journal_s *s_journal;
struct list_head s_orphan; struct list_head s_orphan;
unsigned long s_commit_interval; unsigned long s_commit_interval;
struct block_device *journal_bdev; struct block_device *journal_bdev;
......
...@@ -383,8 +383,8 @@ static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path) ...@@ -383,8 +383,8 @@ static void ext4_ext_show_leaf(struct inode *inode, struct ext4_ext_path *path)
ext_debug("\n"); ext_debug("\n");
} }
#else #else
#define ext4_ext_show_path(inode,path) #define ext4_ext_show_path(inode, path)
#define ext4_ext_show_leaf(inode,path) #define ext4_ext_show_leaf(inode, path)
#endif #endif
void ext4_ext_drop_refs(struct ext4_ext_path *path) void ext4_ext_drop_refs(struct ext4_ext_path *path)
...@@ -1476,7 +1476,7 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode, ...@@ -1476,7 +1476,7 @@ int ext4_ext_insert_extent(handle_t *handle, struct inode *inode,
struct ext4_ext_path *path, struct ext4_ext_path *path,
struct ext4_extent *newext) struct ext4_extent *newext)
{ {
struct ext4_extent_header * eh; struct ext4_extent_header *eh;
struct ext4_extent *ex, *fex; struct ext4_extent *ex, *fex;
struct ext4_extent *nearex; /* nearest extent */ struct ext4_extent *nearex; /* nearest extent */
struct ext4_ext_path *npath = NULL; struct ext4_ext_path *npath = NULL;
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
* from ext4_file_open: open gets called at every open, but release * from ext4_file_open: open gets called at every open, but release
* gets called only when /all/ the files are closed. * gets called only when /all/ the files are closed.
*/ */
static int ext4_release_file (struct inode * inode, struct file * filp) static int ext4_release_file(struct inode *inode, struct file *filp)
{ {
/* if we are the last writer on the inode, drop the block reservation */ /* if we are the last writer on the inode, drop the block reservation */
if ((filp->f_mode & FMODE_WRITE) && if ((filp->f_mode & FMODE_WRITE) &&
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
* inode to disk. * inode to disk.
*/ */
int ext4_sync_file(struct file * file, struct dentry *dentry, int datasync) int ext4_sync_file(struct file *file, struct dentry *dentry, int datasync)
{ {
struct inode *inode = dentry->d_inode; struct inode *inode = dentry->d_inode;
journal_t *journal = EXT4_SB(inode->i_sb)->s_journal; journal_t *journal = EXT4_SB(inode->i_sb)->s_journal;
......
...@@ -27,7 +27,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[]) ...@@ -27,7 +27,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[])
sum += DELTA; sum += DELTA;
b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b); b0 += ((b1 << 4)+a) ^ (b1+sum) ^ ((b1 >> 5)+b);
b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d); b1 += ((b0 << 4)+c) ^ (b0+sum) ^ ((b0 >> 5)+d);
} while(--n); } while (--n);
buf[0] += b0; buf[0] += b0;
buf[1] += b1; buf[1] += b1;
...@@ -35,7 +35,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[]) ...@@ -35,7 +35,7 @@ static void TEA_transform(__u32 buf[4], __u32 const in[])
/* The old legacy hash */ /* The old legacy hash */
static __u32 dx_hack_hash (const char *name, int len) static __u32 dx_hack_hash(const char *name, int len)
{ {
__u32 hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9; __u32 hash0 = 0x12a3fe2d, hash1 = 0x37abe8f9;
while (len--) { while (len--) {
...@@ -59,7 +59,7 @@ static void str2hashbuf(const char *msg, int len, __u32 *buf, int num) ...@@ -59,7 +59,7 @@ static void str2hashbuf(const char *msg, int len, __u32 *buf, int num)
val = pad; val = pad;
if (len > num*4) if (len > num*4)
len = num * 4; len = num * 4;
for (i=0; i < len; i++) { for (i = 0; i < len; i++) {
if ((i % 4) == 0) if ((i % 4) == 0)
val = pad; val = pad;
val = msg[i] + (val << 8); val = msg[i] + (val << 8);
...@@ -104,7 +104,7 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo) ...@@ -104,7 +104,7 @@ int ext4fs_dirhash(const char *name, int len, struct dx_hash_info *hinfo)
/* Check to see if the seed is all zero's */ /* Check to see if the seed is all zero's */
if (hinfo->seed) { if (hinfo->seed) {
for (i=0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (hinfo->seed[i]) if (hinfo->seed[i])
break; break;
} }
......
...@@ -154,17 +154,17 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group) ...@@ -154,17 +154,17 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
* though), and then we'd have two inodes sharing the * though), and then we'd have two inodes sharing the
* same inode number and space on the harddisk. * same inode number and space on the harddisk.
*/ */
void ext4_free_inode (handle_t *handle, struct inode * inode) void ext4_free_inode(handle_t *handle, struct inode *inode)
{ {
struct super_block * sb = inode->i_sb; struct super_block *sb = inode->i_sb;
int is_directory; int is_directory;
unsigned long ino; unsigned long ino;
struct buffer_head *bitmap_bh = NULL; struct buffer_head *bitmap_bh = NULL;
struct buffer_head *bh2; struct buffer_head *bh2;
ext4_group_t block_group; ext4_group_t block_group;
unsigned long bit; unsigned long bit;
struct ext4_group_desc * gdp; struct ext4_group_desc *gdp;
struct ext4_super_block * es; struct ext4_super_block *es;
struct ext4_sb_info *sbi; struct ext4_sb_info *sbi;
int fatal = 0, err; int fatal = 0, err;
ext4_group_t flex_group; ext4_group_t flex_group;
...@@ -187,7 +187,7 @@ void ext4_free_inode (handle_t *handle, struct inode * inode) ...@@ -187,7 +187,7 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
sbi = EXT4_SB(sb); sbi = EXT4_SB(sb);
ino = inode->i_ino; ino = inode->i_ino;
ext4_debug ("freeing inode %lu\n", ino); ext4_debug("freeing inode %lu\n", ino);
/* /*
* Note: we must free any quota before locking the superblock, * Note: we must free any quota before locking the superblock,
...@@ -201,12 +201,12 @@ void ext4_free_inode (handle_t *handle, struct inode * inode) ...@@ -201,12 +201,12 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
is_directory = S_ISDIR(inode->i_mode); is_directory = S_ISDIR(inode->i_mode);
/* Do this BEFORE marking the inode not in use or returning an error */ /* Do this BEFORE marking the inode not in use or returning an error */
clear_inode (inode); clear_inode(inode);
es = EXT4_SB(sb)->s_es; es = EXT4_SB(sb)->s_es;
if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) { if (ino < EXT4_FIRST_INO(sb) || ino > le32_to_cpu(es->s_inodes_count)) {
ext4_error (sb, "ext4_free_inode", ext4_error(sb, "ext4_free_inode",
"reserved or nonexistent inode %lu", ino); "reserved or nonexistent inode %lu", ino);
goto error_return; goto error_return;
} }
block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb); block_group = (ino - 1) / EXT4_INODES_PER_GROUP(sb);
...@@ -223,10 +223,10 @@ void ext4_free_inode (handle_t *handle, struct inode * inode) ...@@ -223,10 +223,10 @@ void ext4_free_inode (handle_t *handle, struct inode * inode)
/* Ok, now we can actually update the inode bitmaps.. */ /* Ok, now we can actually update the inode bitmaps.. */
if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group), if (!ext4_clear_bit_atomic(sb_bgl_lock(sbi, block_group),
bit, bitmap_bh->b_data)) bit, bitmap_bh->b_data))
ext4_error (sb, "ext4_free_inode", ext4_error(sb, "ext4_free_inode",
"bit already cleared for inode %lu", ino); "bit already cleared for inode %lu", ino);
else { else {
gdp = ext4_get_group_desc (sb, block_group, &bh2); gdp = ext4_get_group_desc(sb, block_group, &bh2);
BUFFER_TRACE(bh2, "get_write_access"); BUFFER_TRACE(bh2, "get_write_access");
fatal = ext4_journal_get_write_access(handle, bh2); fatal = ext4_journal_get_write_access(handle, bh2);
...@@ -288,7 +288,7 @@ static int find_group_dir(struct super_block *sb, struct inode *parent, ...@@ -288,7 +288,7 @@ static int find_group_dir(struct super_block *sb, struct inode *parent,
avefreei = freei / ngroups; avefreei = freei / ngroups;
for (group = 0; group < ngroups; group++) { for (group = 0; group < ngroups; group++) {
desc = ext4_get_group_desc (sb, group, NULL); desc = ext4_get_group_desc(sb, group, NULL);
if (!desc || !desc->bg_free_inodes_count) if (!desc || !desc->bg_free_inodes_count)
continue; continue;
if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei) if (le16_to_cpu(desc->bg_free_inodes_count) < avefreei)
...@@ -577,16 +577,16 @@ static int find_group_other(struct super_block *sb, struct inode *parent, ...@@ -577,16 +577,16 @@ static int find_group_other(struct super_block *sb, struct inode *parent,
* For other inodes, search forward from the parent directory's block * For other inodes, search forward from the parent directory's block
* group to find a free inode. * group to find a free inode.
*/ */
struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) struct inode *ext4_new_inode(handle_t *handle, struct inode *dir, int mode)
{ {
struct super_block *sb; struct super_block *sb;
struct buffer_head *bitmap_bh = NULL; struct buffer_head *bitmap_bh = NULL;
struct buffer_head *bh2; struct buffer_head *bh2;
ext4_group_t group = 0; ext4_group_t group = 0;
unsigned long ino = 0; unsigned long ino = 0;
struct inode * inode; struct inode *inode;
struct ext4_group_desc * gdp = NULL; struct ext4_group_desc *gdp = NULL;
struct ext4_super_block * es; struct ext4_super_block *es;
struct ext4_inode_info *ei; struct ext4_inode_info *ei;
struct ext4_sb_info *sbi; struct ext4_sb_info *sbi;
int ret2, err = 0; int ret2, err = 0;
...@@ -614,7 +614,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -614,7 +614,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
} }
if (S_ISDIR(mode)) { if (S_ISDIR(mode)) {
if (test_opt (sb, OLDALLOC)) if (test_opt(sb, OLDALLOC))
ret2 = find_group_dir(sb, dir, &group); ret2 = find_group_dir(sb, dir, &group);
else else
ret2 = find_group_orlov(sb, dir, &group); ret2 = find_group_orlov(sb, dir, &group);
...@@ -784,7 +784,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -784,7 +784,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
} }
inode->i_uid = current->fsuid; inode->i_uid = current->fsuid;
if (test_opt (sb, GRPID)) if (test_opt(sb, GRPID))
inode->i_gid = dir->i_gid; inode->i_gid = dir->i_gid;
else if (dir->i_mode & S_ISGID) { else if (dir->i_mode & S_ISGID) {
inode->i_gid = dir->i_gid; inode->i_gid = dir->i_gid;
...@@ -833,7 +833,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -833,7 +833,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize; ei->i_extra_isize = EXT4_SB(sb)->s_want_extra_isize;
ret = inode; ret = inode;
if(DQUOT_ALLOC_INODE(inode)) { if (DQUOT_ALLOC_INODE(inode)) {
err = -EDQUOT; err = -EDQUOT;
goto fail_drop; goto fail_drop;
} }
...@@ -842,7 +842,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode) ...@@ -842,7 +842,7 @@ struct inode *ext4_new_inode(handle_t *handle, struct inode * dir, int mode)
if (err) if (err)
goto fail_free_drop; goto fail_free_drop;
err = ext4_init_security(handle,inode, dir); err = ext4_init_security(handle, inode, dir);
if (err) if (err)
goto fail_free_drop; goto fail_free_drop;
...@@ -960,7 +960,7 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino) ...@@ -960,7 +960,7 @@ struct inode *ext4_orphan_get(struct super_block *sb, unsigned long ino)
return ERR_PTR(err); return ERR_PTR(err);
} }
unsigned long ext4_count_free_inodes (struct super_block * sb) unsigned long ext4_count_free_inodes(struct super_block *sb)
{ {
unsigned long desc_count; unsigned long desc_count;
struct ext4_group_desc *gdp; struct ext4_group_desc *gdp;
...@@ -975,7 +975,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb) ...@@ -975,7 +975,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
bitmap_count = 0; bitmap_count = 0;
gdp = NULL; gdp = NULL;
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) { for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
gdp = ext4_get_group_desc (sb, i, NULL); gdp = ext4_get_group_desc(sb, i, NULL);
if (!gdp) if (!gdp)
continue; continue;
desc_count += le16_to_cpu(gdp->bg_free_inodes_count); desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
...@@ -997,7 +997,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb) ...@@ -997,7 +997,7 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
#else #else
desc_count = 0; desc_count = 0;
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) { for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
gdp = ext4_get_group_desc (sb, i, NULL); gdp = ext4_get_group_desc(sb, i, NULL);
if (!gdp) if (!gdp)
continue; continue;
desc_count += le16_to_cpu(gdp->bg_free_inodes_count); desc_count += le16_to_cpu(gdp->bg_free_inodes_count);
...@@ -1008,13 +1008,13 @@ unsigned long ext4_count_free_inodes (struct super_block * sb) ...@@ -1008,13 +1008,13 @@ unsigned long ext4_count_free_inodes (struct super_block * sb)
} }
/* Called at mount-time, super-block is locked */ /* Called at mount-time, super-block is locked */
unsigned long ext4_count_dirs (struct super_block * sb) unsigned long ext4_count_dirs(struct super_block * sb)
{ {
unsigned long count = 0; unsigned long count = 0;
ext4_group_t i; ext4_group_t i;
for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) { for (i = 0; i < EXT4_SB(sb)->s_groups_count; i++) {
struct ext4_group_desc *gdp = ext4_get_group_desc (sb, i, NULL); struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL);
if (!gdp) if (!gdp)
continue; continue;
count += le16_to_cpu(gdp->bg_used_dirs_count); count += le16_to_cpu(gdp->bg_used_dirs_count);
......
This diff is collapsed.
...@@ -25,7 +25,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -25,7 +25,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
unsigned int flags; unsigned int flags;
unsigned short rsv_window_size; unsigned short rsv_window_size;
ext4_debug ("cmd = %u, arg = %lu\n", cmd, arg); ext4_debug("cmd = %u, arg = %lu\n", cmd, arg);
switch (cmd) { switch (cmd) {
case EXT4_IOC_GETFLAGS: case EXT4_IOC_GETFLAGS:
...@@ -186,7 +186,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) ...@@ -186,7 +186,7 @@ long ext4_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
case EXT4_IOC_SETRSVSZ: { case EXT4_IOC_SETRSVSZ: {
int err; int err;
if (!test_opt(inode->i_sb, RESERVATION) ||!S_ISREG(inode->i_mode)) if (!test_opt(inode->i_sb, RESERVATION) || !S_ISREG(inode->i_mode))
return -ENOTTY; return -ENOTTY;
if (!is_owner_or_cap(inode)) if (!is_owner_or_cap(inode))
......
This diff is collapsed.
...@@ -416,8 +416,8 @@ static int add_new_gdb(handle_t *handle, struct inode *inode, ...@@ -416,8 +416,8 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
"EXT4-fs: ext4_add_new_gdb: adding group block %lu\n", "EXT4-fs: ext4_add_new_gdb: adding group block %lu\n",
gdb_num); gdb_num);
/* /*
* If we are not using the primary superblock/GDT copy don't resize, * If we are not using the primary superblock/GDT copy don't resize,
* because the user tools have no way of handling this. Probably a * because the user tools have no way of handling this. Probably a
* bad time to do it anyways. * bad time to do it anyways.
*/ */
...@@ -964,7 +964,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es, ...@@ -964,7 +964,7 @@ int ext4_group_extend(struct super_block *sb, struct ext4_super_block *es,
ext4_group_t o_groups_count; ext4_group_t o_groups_count;
ext4_grpblk_t last; ext4_grpblk_t last;
ext4_grpblk_t add; ext4_grpblk_t add;
struct buffer_head * bh; struct buffer_head *bh;
handle_t *handle; handle_t *handle;
int err; int err;
unsigned long freed_blocks; unsigned long freed_blocks;
......
...@@ -654,7 +654,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq, ...@@ -654,7 +654,7 @@ static inline void ext4_show_quota_options(struct seq_file *seq,
if (sbi->s_jquota_fmt) if (sbi->s_jquota_fmt)
seq_printf(seq, ",jqfmt=%s", seq_printf(seq, ",jqfmt=%s",
(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold": "vfsv0"); (sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold" : "vfsv0");
if (sbi->s_qf_names[USRQUOTA]) if (sbi->s_qf_names[USRQUOTA])
seq_printf(seq, ",usrjquota=%s", sbi->s_qf_names[USRQUOTA]); seq_printf(seq, ",usrjquota=%s", sbi->s_qf_names[USRQUOTA]);
...@@ -822,7 +822,7 @@ static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid, ...@@ -822,7 +822,7 @@ static struct dentry *ext4_fh_to_parent(struct super_block *sb, struct fid *fid,
} }
#ifdef CONFIG_QUOTA #ifdef CONFIG_QUOTA
#define QTYPE2NAME(t) ((t) == USRQUOTA?"user":"group") #define QTYPE2NAME(t) ((t) == USRQUOTA ? "user" : "group")
#define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA)) #define QTYPE2MOPT(on, t) ((t) == USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))
static int ext4_dquot_initialize(struct inode *inode, int type); static int ext4_dquot_initialize(struct inode *inode, int type);
...@@ -1586,7 +1586,7 @@ static int ext4_check_descriptors(struct super_block *sb) ...@@ -1586,7 +1586,7 @@ static int ext4_check_descriptors(struct super_block *sb)
if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG)) if (EXT4_HAS_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_FLEX_BG))
flexbg_flag = 1; flexbg_flag = 1;
ext4_debug ("Checking group descriptors"); ext4_debug("Checking group descriptors");
for (i = 0; i < sbi->s_groups_count; i++) { for (i = 0; i < sbi->s_groups_count; i++) {
struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL); struct ext4_group_desc *gdp = ext4_get_group_desc(sb, i, NULL);
......
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#include "ext4.h" #include "ext4.h"
#include "xattr.h" #include "xattr.h"
static void * ext4_follow_link(struct dentry *dentry, struct nameidata *nd) static void *ext4_follow_link(struct dentry *dentry, struct nameidata *nd)
{ {
struct ext4_inode_info *ei = EXT4_I(dentry->d_inode); struct ext4_inode_info *ei = EXT4_I(dentry->d_inode);
nd_set_link(nd, (char*)ei->i_data); nd_set_link(nd, (char *) ei->i_data);
return NULL; return NULL;
} }
......
...@@ -51,8 +51,8 @@ struct ext4_xattr_entry { ...@@ -51,8 +51,8 @@ struct ext4_xattr_entry {
(((name_len) + EXT4_XATTR_ROUND + \ (((name_len) + EXT4_XATTR_ROUND + \
sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND) sizeof(struct ext4_xattr_entry)) & ~EXT4_XATTR_ROUND)
#define EXT4_XATTR_NEXT(entry) \ #define EXT4_XATTR_NEXT(entry) \
( (struct ext4_xattr_entry *)( \ ((struct ext4_xattr_entry *)( \
(char *)(entry) + EXT4_XATTR_LEN((entry)->e_name_len)) ) (char *)(entry) + EXT4_XATTR_LEN((entry)->e_name_len)))
#define EXT4_XATTR_SIZE(size) \ #define EXT4_XATTR_SIZE(size) \
(((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND) (((size) + EXT4_XATTR_ROUND) & ~EXT4_XATTR_ROUND)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment