This patch set fixes some coding style warnings which are from
checkpatch.pl.
Detail warning/error messages are below:
WARNING: function definition argument 'struct inode *' should
also have an identifier name
WARNING: space prohibited between function name and open
parenthesis '('
WARNING: line over 80 characters
ERROR: "foo * bar" should be "foo *bar"
---
Chengguang Xu (10):
ext2: fix coding style for acl.h
ext2: fix coding style for balloc.c
ext2: fix coding style for dir.c
ext2: fix coding style for ext2.h
ext2: fix coding style for inode.c
ext2: fix coding style for file.c
ext2: fix coding style for ialloc.c
ext2: fix coding style for namei.c
ext2: fix coding style for super.c
ext2: fix coding style for xattr.c
fs/ext2/acl.h | 4 +-
fs/ext2/balloc.c | 34 ++++++++--------
fs/ext2/dir.c | 18 ++++-----
fs/ext2/ext2.h | 100 +++++++++++++++++++++++++++--------------------
fs/ext2/file.c | 2 +-
fs/ext2/ialloc.c | 18 ++++-----
fs/ext2/inode.c | 12 +++---
fs/ext2/namei.c | 55 ++++++++++++++------------
fs/ext2/super.c | 26 ++++++------
fs/ext2/xattr.c | 17 ++++----
10 files changed, 152 insertions(+), 134 deletions(-)
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/namei.c | 55 ++++++++++++++++++++++++++-----------------------
1 file changed, 29 insertions(+), 26 deletions(-)
diff --git a/fs/ext2/namei.c b/fs/ext2/namei.c
index 0c26dcc5d850..1368324a68e8 100644
--- a/fs/ext2/namei.c
+++ b/fs/ext2/namei.c
@@ -53,9 +53,10 @@ static inline int ext2_add_nondir(struct dentry *dentry, struct inode *inode)
* Methods themselves.
*/
-static struct dentry *ext2_lookup(struct inode * dir, struct dentry *dentry, unsigned int flags)
+static struct dentry *ext2_lookup(struct inode *dir, struct dentry *dentry,
+ unsigned int flags)
{
- struct inode * inode;
+ struct inode *inode;
ino_t ino;
if (dentry->d_name.len > EXT2_NAME_LEN)
@@ -92,7 +93,8 @@ struct dentry *ext2_get_parent(struct dentry *child)
* If the create succeeds, we fill in the inode information
* with d_instantiate().
*/
-static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, bool excl)
+static int ext2_create(struct inode *dir, struct dentry *dentry, umode_t mode,
+ bool excl)
{
struct inode *inode;
int err;
@@ -123,9 +125,10 @@ static int ext2_tmpfile(struct inode *dir, struct dentry *dentry, umode_t mode)
return 0;
}
-static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode, dev_t rdev)
+static int ext2_mknod(struct inode *dir, struct dentry *dentry, umode_t mode,
+ dev_t rdev)
{
- struct inode * inode;
+ struct inode *inode;
int err;
err = dquot_initialize(dir);
@@ -145,13 +148,13 @@ static int ext2_mknod (struct inode * dir, struct dentry *dentry, umode_t mode,
return err;
}
-static int ext2_symlink (struct inode * dir, struct dentry * dentry,
- const char * symname)
+static int ext2_symlink(struct inode *dir, struct dentry *dentry,
+ const char *symname)
{
- struct super_block * sb = dir->i_sb;
+ struct super_block *sb = dir->i_sb;
int err = -ENAMETOOLONG;
unsigned l = strlen(symname)+1;
- struct inode * inode;
+ struct inode *inode;
if (l > sb->s_blocksize)
goto out;
@@ -195,7 +198,7 @@ static int ext2_symlink (struct inode * dir, struct dentry * dentry,
goto out;
}
-static int ext2_link (struct dentry * old_dentry, struct inode * dir,
+static int ext2_link(struct dentry *old_dentry, struct inode *dir,
struct dentry *dentry)
{
struct inode *inode = d_inode(old_dentry);
@@ -219,9 +222,9 @@ static int ext2_link (struct dentry * old_dentry, struct inode * dir,
return err;
}
-static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
+static int ext2_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
{
- struct inode * inode;
+ struct inode *inode;
int err;
err = dquot_initialize(dir);
@@ -265,11 +268,11 @@ static int ext2_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
goto out;
}
-static int ext2_unlink(struct inode * dir, struct dentry *dentry)
+static int ext2_unlink(struct inode *dir, struct dentry *dentry)
{
- struct inode * inode = d_inode(dentry);
- struct ext2_dir_entry_2 * de;
- struct page * page;
+ struct inode *inode = d_inode(dentry);
+ struct ext2_dir_entry_2 *de;
+ struct page *page;
int err;
err = dquot_initialize(dir);
@@ -293,9 +296,9 @@ static int ext2_unlink(struct inode * dir, struct dentry *dentry)
return err;
}
-static int ext2_rmdir (struct inode * dir, struct dentry *dentry)
+static int ext2_rmdir(struct inode *dir, struct dentry *dentry)
{
- struct inode * inode = d_inode(dentry);
+ struct inode *inode = d_inode(dentry);
int err = -ENOTEMPTY;
if (ext2_empty_dir(inode)) {
@@ -309,16 +312,16 @@ static int ext2_rmdir (struct inode * dir, struct dentry *dentry)
return err;
}
-static int ext2_rename (struct inode * old_dir, struct dentry * old_dentry,
- struct inode * new_dir, struct dentry * new_dentry,
+static int ext2_rename(struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry,
unsigned int flags)
{
- struct inode * old_inode = d_inode(old_dentry);
- struct inode * new_inode = d_inode(new_dentry);
- struct page * dir_page = NULL;
- struct ext2_dir_entry_2 * dir_de = NULL;
- struct page * old_page;
- struct ext2_dir_entry_2 * old_de;
+ struct inode *old_inode = d_inode(old_dentry);
+ struct inode *new_inode = d_inode(new_dentry);
+ struct page *dir_page = NULL;
+ struct ext2_dir_entry_2 *dir_de = NULL;
+ struct page *old_page;
+ struct ext2_dir_entry_2 *old_de;
int err;
if (flags & ~RENAME_NOREPLACE)
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/acl.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/fs/ext2/acl.h b/fs/ext2/acl.h
index 0f01c759daac..768e490ac5e5 100644
--- a/fs/ext2/acl.h
+++ b/fs/ext2/acl.h
@@ -57,14 +57,14 @@ static inline int ext2_acl_count(size_t size)
/* acl.c */
extern struct posix_acl *ext2_get_acl(struct inode *inode, int type);
extern int ext2_set_acl(struct inode *inode, struct posix_acl *acl, int type);
-extern int ext2_init_acl (struct inode *, struct inode *);
+extern int ext2_init_acl(struct inode *inode, struct inode *dir);
#else
#include <linux/sched.h>
#define ext2_get_acl NULL
#define ext2_set_acl NULL
-static inline int ext2_init_acl (struct inode *inode, struct inode *dir)
+static inline int ext2_init_acl(struct inode *inode, struct inode *dir)
{
return 0;
}
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/dir.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 3b8114def693..9fd1ad886f9f 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -196,7 +196,7 @@ static bool ext2_check_page(struct page *page, int quiet)
return false;
}
-static struct page * ext2_get_page(struct inode *dir, unsigned long n,
+static struct page *ext2_get_page(struct inode *dir, unsigned long n,
int quiet)
{
struct address_space *mapping = dir->i_mapping;
@@ -220,8 +220,8 @@ static struct page * ext2_get_page(struct inode *dir, unsigned long n,
*
* len <= EXT2_NAME_LEN and de != NULL are guaranteed by caller.
*/
-static inline int ext2_match (int len, const char * const name,
- struct ext2_dir_entry_2 * de)
+static inline int ext2_match(int len, const char * const name,
+ struct ext2_dir_entry_2 *de)
{
if (len != de->name_len)
return 0;
@@ -425,7 +425,7 @@ struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir,
return de;
}
-struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)
+struct ext2_dir_entry_2 *ext2_dotdot(struct inode *dir, struct page **p)
{
struct page *page = ext2_get_page(dir, 0, 0);
ext2_dirent *de = NULL;
@@ -443,7 +443,7 @@ ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child)
struct ext2_dir_entry_2 *de;
struct page *page;
- de = ext2_find_entry (dir, child, &page);
+ de = ext2_find_entry(dir, child, &page);
if (de) {
res = le32_to_cpu(de->inode);
ext2_put_page(page);
@@ -481,7 +481,7 @@ void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
/*
* Parent is locked.
*/
-int ext2_add_link (struct dentry *dentry, struct inode *inode)
+int ext2_add_link(struct dentry *dentry, struct inode *inode)
{
struct inode *dir = d_inode(dentry->d_parent);
const char *name = dentry->d_name.name;
@@ -490,7 +490,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
unsigned reclen = EXT2_DIR_REC_LEN(namelen);
unsigned short rec_len, name_len;
struct page *page = NULL;
- ext2_dirent * de;
+ ext2_dirent *de;
unsigned long npages = dir_pages(dir);
unsigned long n;
char *kaddr;
@@ -580,7 +580,7 @@ int ext2_add_link (struct dentry *dentry, struct inode *inode)
* ext2_delete_entry deletes a directory entry by merging it with the
* previous entry. Page is up-to-date. Releases the page.
*/
-int ext2_delete_entry (struct ext2_dir_entry_2 * dir, struct page * page )
+int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct page *page)
{
struct inode *inode = page->mapping->host;
char *kaddr = page_address(page);
@@ -664,7 +664,7 @@ int ext2_make_empty(struct inode *inode, struct inode *parent)
/*
* routine to check that the specified directory is empty (for rmdir)
*/
-int ext2_empty_dir (struct inode * inode)
+int ext2_empty_dir(struct inode *inode)
{
struct page *page = NULL;
unsigned long i, npages = dir_pages(inode);
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/super.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index cb91baa4275d..c58ca931a2e5 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -39,8 +39,8 @@
#include "acl.h"
static void ext2_write_super(struct super_block *sb);
-static int ext2_remount (struct super_block * sb, int * flags, char * data);
-static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf);
+static int ext2_remount(struct super_block *sb, int *flags, char *data);
+static int ext2_statfs(struct dentry *dentry, struct kstatfs *buf);
static int ext2_sync_fs(struct super_block *sb, int wait);
static int ext2_freeze(struct super_block *sb);
static int ext2_unfreeze(struct super_block *sb);
@@ -140,7 +140,7 @@ static inline void ext2_quota_off_umount(struct super_block *sb)
}
#endif
-static void ext2_put_super (struct super_block * sb)
+static void ext2_put_super(struct super_block *sb)
{
int db_count;
int i;
@@ -176,7 +176,7 @@ static void ext2_put_super (struct super_block * sb)
kfree(sbi);
}
-static struct kmem_cache * ext2_inode_cachep;
+static struct kmem_cache *ext2_inode_cachep;
static struct inode *ext2_alloc_inode(struct super_block *sb)
{
@@ -648,8 +648,8 @@ static int parse_options(char *options, struct super_block *sb,
return 1;
}
-static int ext2_setup_super (struct super_block * sb,
- struct ext2_super_block * es,
+static int ext2_setup_super(struct super_block *sb,
+ struct ext2_super_block *es,
int read_only)
{
int res = 0;
@@ -819,9 +819,9 @@ static unsigned long descriptor_loc(struct super_block *sb,
static int ext2_fill_super(struct super_block *sb, void *data, int silent)
{
struct dax_device *dax_dev = fs_dax_get_by_bdev(sb->s_bdev);
- struct buffer_head * bh;
- struct ext2_sb_info * sbi;
- struct ext2_super_block * es;
+ struct buffer_head *bh;
+ struct ext2_sb_info *sbi;
+ struct ext2_super_block *es;
struct inode *root;
unsigned long block;
unsigned long sb_block = get_sb_block(&data);
@@ -1321,10 +1321,10 @@ static void ext2_write_super(struct super_block *sb)
ext2_sync_fs(sb, 1);
}
-static int ext2_remount (struct super_block * sb, int * flags, char * data)
+static int ext2_remount(struct super_block *sb, int *flags, char *data)
{
- struct ext2_sb_info * sbi = EXT2_SB(sb);
- struct ext2_super_block * es;
+ struct ext2_sb_info *sbi = EXT2_SB(sb);
+ struct ext2_super_block *es;
struct ext2_mount_options new_opts;
int err;
@@ -1404,7 +1404,7 @@ static int ext2_remount (struct super_block * sb, int * flags, char * data)
return 0;
}
-static int ext2_statfs (struct dentry * dentry, struct kstatfs * buf)
+static int ext2_statfs(struct dentry *dentry, struct kstatfs *buf)
{
struct super_block *sb = dentry->d_sb;
struct ext2_sb_info *sbi = EXT2_SB(sb);
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/ialloc.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/fs/ext2/ialloc.c b/fs/ext2/ialloc.c
index 5c3d7b7e4975..38165101df3b 100644
--- a/fs/ext2/ialloc.c
+++ b/fs/ext2/ialloc.c
@@ -44,7 +44,7 @@
* Return buffer_head of bitmap on success or NULL.
*/
static struct buffer_head *
-read_inode_bitmap(struct super_block * sb, unsigned long block_group)
+read_inode_bitmap(struct super_block *sb, unsigned long block_group)
{
struct ext2_group_desc *desc;
struct buffer_head *bh = NULL;
@@ -65,7 +65,7 @@ read_inode_bitmap(struct super_block * sb, unsigned long block_group)
static void ext2_release_inode(struct super_block *sb, int group, int dir)
{
- struct ext2_group_desc * desc;
+ struct ext2_group_desc *desc;
struct buffer_head *bh;
desc = ext2_get_group_desc(sb, group, &bh);
@@ -101,15 +101,15 @@ static void ext2_release_inode(struct super_block *sb, int group, int dir)
* though), and then we'd have two inodes sharing the
* same inode number and space on the harddisk.
*/
-void ext2_free_inode (struct inode * inode)
+void ext2_free_inode(struct inode *inode)
{
- struct super_block * sb = inode->i_sb;
+ struct super_block *sb = inode->i_sb;
int is_directory;
unsigned long ino;
struct buffer_head *bitmap_bh;
unsigned long block_group;
unsigned long bit;
- struct ext2_super_block * es;
+ struct ext2_super_block *es;
ino = inode->i_ino;
ext2_debug ("freeing inode %lu\n", ino);
@@ -168,7 +168,7 @@ static void ext2_preread_inode(struct inode *inode)
unsigned long block_group;
unsigned long offset;
unsigned long block;
- struct ext2_group_desc * gdp;
+ struct ext2_group_desc *gdp;
struct backing_dev_info *bdi;
bdi = inode_to_bdi(inode);
@@ -436,7 +436,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
struct buffer_head *bh2;
int group, i;
ino_t ino = 0;
- struct inode * inode;
+ struct inode *inode;
struct ext2_group_desc *gdp;
struct ext2_super_block *es;
struct ext2_inode_info *ei;
@@ -620,7 +620,7 @@ struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
return ERR_PTR(err);
}
-unsigned long ext2_count_free_inodes (struct super_block * sb)
+unsigned long ext2_count_free_inodes(struct super_block *sb)
{
struct ext2_group_desc *desc;
unsigned long desc_count = 0;
@@ -667,7 +667,7 @@ unsigned long ext2_count_free_inodes (struct super_block * sb)
}
/* Called at mount-time, super-block is locked */
-unsigned long ext2_count_dirs (struct super_block * sb)
+unsigned long ext2_count_dirs(struct super_block *sb)
{
unsigned long count = 0;
int i;
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/inode.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/fs/ext2/inode.c b/fs/ext2/inode.c
index e4bb9386c045..63a6cf33cd78 100644
--- a/fs/ext2/inode.c
+++ b/fs/ext2/inode.c
@@ -69,7 +69,7 @@ static void ext2_write_failed(struct address_space *mapping, loff_t to)
/*
* Called at the last iput() if i_nlink is zero.
*/
-void ext2_evict_inode(struct inode * inode)
+void ext2_evict_inode(struct inode *inode)
{
struct ext2_block_alloc_info *rsv;
int want_delete = 0;
@@ -359,7 +359,7 @@ static inline ext2_fsblk_t ext2_find_goal(struct inode *inode, long block,
* direct and indirect blocks.
*/
static int
-ext2_blks_to_allocate(Indirect * branch, int k, unsigned long blks,
+ext2_blks_to_allocate(Indirect *branch, int k, unsigned long blks,
int blocks_to_boundary)
{
unsigned long count = 0;
@@ -1393,10 +1393,10 @@ void ext2_set_file_ops(struct inode *inode)
inode->i_mapping->a_ops = &ext2_aops;
}
-struct inode *ext2_iget (struct super_block *sb, unsigned long ino)
+struct inode *ext2_iget(struct super_block *sb, unsigned long ino)
{
struct ext2_inode_info *ei;
- struct buffer_head * bh;
+ struct buffer_head *bh;
struct ext2_inode *raw_inode;
struct inode *inode;
long ret = -EIO;
@@ -1533,8 +1533,8 @@ static int __ext2_write_inode(struct inode *inode, int do_sync)
ino_t ino = inode->i_ino;
uid_t uid = i_uid_read(inode);
gid_t gid = i_gid_read(inode);
- struct buffer_head * bh;
- struct ext2_inode * raw_inode = ext2_get_inode(sb, ino, &bh);
+ struct buffer_head *bh;
+ struct ext2_inode *raw_inode = ext2_get_inode(sb, ino, &bh);
int n;
int err = 0;
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/balloc.c | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/fs/ext2/balloc.c b/fs/ext2/balloc.c
index 33db13365c5e..12fd52b9488f 100644
--- a/fs/ext2/balloc.c
+++ b/fs/ext2/balloc.c
@@ -38,13 +38,13 @@
#define in_range(b, first, len) ((b) >= (first) && (b) <= (first) + (len) - 1)
-struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
+struct ext2_group_desc *ext2_get_group_desc(struct super_block *sb,
unsigned int block_group,
- struct buffer_head ** bh)
+ struct buffer_head **bh)
{
unsigned long group_desc;
unsigned long offset;
- struct ext2_group_desc * desc;
+ struct ext2_group_desc *desc;
struct ext2_sb_info *sbi = EXT2_SB(sb);
if (block_group >= sbi->s_groups_count) {
@@ -125,8 +125,8 @@ static int ext2_valid_block_bitmap(struct super_block *sb,
static struct buffer_head *
read_block_bitmap(struct super_block *sb, unsigned int block_group)
{
- struct ext2_group_desc * desc;
- struct buffer_head * bh = NULL;
+ struct ext2_group_desc *desc;
+ struct buffer_head *bh = NULL;
ext2_fsblk_t bitmap_blk;
desc = ext2_get_group_desc(sb, block_group, NULL);
@@ -335,8 +335,8 @@ void ext2_rsv_window_add(struct super_block *sb,
struct rb_node *node = &rsv->rsv_node;
ext2_fsblk_t start = rsv->rsv_start;
- struct rb_node ** p = &root->rb_node;
- struct rb_node * parent = NULL;
+ struct rb_node **p = &root->rb_node;
+ struct rb_node *parent = NULL;
struct ext2_reserve_window_node *this;
while (*p)
@@ -475,19 +475,19 @@ void ext2_discard_reservation(struct inode *inode)
* @block: start physical block to free
* @count: number of blocks to free
*/
-void ext2_free_blocks (struct inode * inode, unsigned long block,
- unsigned long count)
+void ext2_free_blocks(struct inode *inode, unsigned long block,
+ unsigned long count)
{
struct buffer_head *bitmap_bh = NULL;
- struct buffer_head * bh2;
+ struct buffer_head *bh2;
unsigned long block_group;
unsigned long bit;
unsigned long i;
unsigned long overflow;
- struct super_block * sb = inode->i_sb;
- struct ext2_sb_info * sbi = EXT2_SB(sb);
- struct ext2_group_desc * desc;
- struct ext2_super_block * es = sbi->s_es;
+ struct super_block *sb = inode->i_sb;
+ struct ext2_sb_info *sbi = EXT2_SB(sb);
+ struct ext2_group_desc *desc;
+ struct ext2_super_block *es = sbi->s_es;
unsigned freed = 0, group_freed;
if (block < le32_to_cpu(es->s_first_data_block) ||
@@ -778,7 +778,7 @@ ext2_try_to_allocate(struct super_block *sb, int group,
static int find_next_reservable_window(
struct ext2_reserve_window_node *search_head,
struct ext2_reserve_window_node *my_rsv,
- struct super_block * sb,
+ struct super_block *sb,
ext2_fsblk_t start_block,
ext2_fsblk_t last_block)
{
@@ -1466,9 +1466,9 @@ unsigned long ext2_count_free(struct buffer_head *map, unsigned int numchars)
#endif /* EXT2FS_DEBUG */
-unsigned long ext2_count_free_blocks (struct super_block * sb)
+unsigned long ext2_count_free_blocks(struct super_block *sb)
{
- struct ext2_group_desc * desc;
+ struct ext2_group_desc *desc;
unsigned long desc_count = 0;
int i;
#ifdef EXT2FS_DEBUG
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/ext2.h | 100 ++++++++++++++++++++++++++++---------------------
1 file changed, 57 insertions(+), 43 deletions(-)
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index e770cd100a6a..6b1a7633771e 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -80,10 +80,11 @@ struct ext2_sb_info {
unsigned long s_groups_count; /* Number of groups in the fs */
unsigned long s_overhead_last; /* Last calculated overhead */
unsigned long s_blocks_last; /* Last seen block count */
- struct buffer_head * s_sbh; /* Buffer containing the super block */
- struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */
- struct buffer_head ** s_group_desc;
- unsigned long s_mount_opt;
+ struct buffer_head *s_sbh; /* Buffer containing the super block */
+ /* Pointer to the super block in the buffer */
+ struct ext2_super_block *s_es;
+ struct buffer_head **s_group_desc;
+ unsigned long s_mount_opt;
unsigned long s_sb_block;
kuid_t s_resuid;
kgid_t s_resgid;
@@ -198,8 +199,8 @@ static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
*/
struct ext2_group_desc
{
- __le32 bg_block_bitmap; /* Blocks bitmap block */
- __le32 bg_inode_bitmap; /* Inodes bitmap block */
+ __le32 bg_block_bitmap; /* Blocks bitmap block */
+ __le32 bg_inode_bitmap; /* Inodes bitmap block */
__le32 bg_inode_table; /* Inodes table block */
__le16 bg_free_blocks_count; /* Free blocks count */
__le16 bg_free_inodes_count; /* Free inodes count */
@@ -735,62 +736,75 @@ static inline struct ext2_inode_info *EXT2_I(struct inode *inode)
/* balloc.c */
extern int ext2_bg_has_super(struct super_block *sb, int group);
extern unsigned long ext2_bg_num_gdb(struct super_block *sb, int group);
-extern ext2_fsblk_t ext2_new_block(struct inode *, unsigned long, int *);
-extern ext2_fsblk_t ext2_new_blocks(struct inode *, unsigned long,
- unsigned long *, int *);
-extern int ext2_data_block_valid(struct ext2_sb_info *sbi, ext2_fsblk_t start_blk,
- unsigned int count);
-extern void ext2_free_blocks (struct inode *, unsigned long,
- unsigned long);
-extern unsigned long ext2_count_free_blocks (struct super_block *);
-extern unsigned long ext2_count_dirs (struct super_block *);
-extern struct ext2_group_desc * ext2_get_group_desc(struct super_block * sb,
- unsigned int block_group,
- struct buffer_head ** bh);
-extern void ext2_discard_reservation (struct inode *);
+extern ext2_fsblk_t ext2_new_block(struct inode *inode, unsigned long goal,
+ int *errp);
+extern ext2_fsblk_t ext2_new_blocks(struct inode *inode, ext2_fsblk_t goal,
+ unsigned long *count, int *errp);
+extern int ext2_data_block_valid(struct ext2_sb_info *sbi,
+ ext2_fsblk_t start_blk, unsigned int count);
+extern void ext2_free_blocks(struct inode *inode, unsigned long block,
+ unsigned long count);
+extern unsigned long ext2_count_free_blocks(struct super_block *sb);
+extern unsigned long ext2_count_dirs(struct super_block *sb);
+extern struct ext2_group_desc *ext2_get_group_desc(struct super_block *sb,
+ unsigned int block_group,
+ struct buffer_head **bh);
+extern void ext2_discard_reservation(struct inode *inode);
extern int ext2_should_retry_alloc(struct super_block *sb, int *retries);
-extern void ext2_init_block_alloc_info(struct inode *);
-extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_window_node *rsv);
+extern void ext2_init_block_alloc_info(struct inode *inode);
+extern void ext2_rsv_window_add(struct super_block *sb,
+ struct ext2_reserve_window_node *rsv);
+extern unsigned long ext2_count_free(struct buffer_head *map,
+ unsigned int numchars);
/* dir.c */
-extern int ext2_add_link (struct dentry *, struct inode *);
-extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *);
-extern int ext2_make_empty(struct inode *, struct inode *);
-extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **);
-extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
-extern int ext2_empty_dir (struct inode *);
-extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
-extern void ext2_set_link(struct inode *, struct ext2_dir_entry_2 *, struct page *, struct inode *, int);
+extern int ext2_add_link(struct dentry *dentry, struct inode *inode);
+extern ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child);
+extern int ext2_make_empty(struct inode *inode, struct inode *parent);
+extern struct ext2_dir_entry_2 *ext2_find_entry(struct inode *dir,
+ const struct qstr *child,
+ struct page **res_page);
+extern int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct page *page);
+extern int ext2_empty_dir(struct inode *inode);
+extern struct ext2_dir_entry_2 *ext2_dotdot(struct inode *dir, struct page **p);
+extern void ext2_set_link(struct inode *dir, struct ext2_dir_entry_2 *de,
+ struct page *page, struct inode *inode,
+ int update_times);
/* ialloc.c */
-extern struct inode * ext2_new_inode (struct inode *, umode_t, const struct qstr *);
-extern void ext2_free_inode (struct inode *);
-extern unsigned long ext2_count_free_inodes (struct super_block *);
-extern unsigned long ext2_count_free (struct buffer_head *, unsigned);
+extern struct inode *ext2_new_inode(struct inode *dir, umode_t mode,
+ const struct qstr *qstr);
+extern void ext2_free_inode(struct inode *inode);
+extern unsigned long ext2_count_free_inodes(struct super_block *sb);
/* inode.c */
-extern struct inode *ext2_iget (struct super_block *, unsigned long);
-extern int ext2_write_inode (struct inode *, struct writeback_control *);
-extern void ext2_evict_inode(struct inode *);
-extern int ext2_get_block(struct inode *, sector_t, struct buffer_head *, int);
-extern int ext2_setattr (struct dentry *, struct iattr *);
+extern struct inode *ext2_iget(struct super_block *sb, unsigned long ino);
+extern int ext2_write_inode(struct inode *inode,
+ struct writeback_control *do_sync);
+extern void ext2_evict_inode(struct inode *inode);
+extern int ext2_get_block(struct inode *inode, sector_t iblock,
+ struct buffer_head *bh_result, int creaate);
+extern int ext2_setattr(struct dentry *dentry, struct iattr *iattr);
extern void ext2_set_inode_flags(struct inode *inode);
extern int ext2_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
u64 start, u64 len);
/* ioctl.c */
-extern long ext2_ioctl(struct file *, unsigned int, unsigned long);
-extern long ext2_compat_ioctl(struct file *, unsigned int, unsigned long);
+extern long ext2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
+extern long ext2_compat_ioctl(struct file *file, unsigned int cmd,
+ unsigned long arg);
/* namei.c */
struct dentry *ext2_get_parent(struct dentry *child);
/* super.c */
extern __printf(3, 4)
-void ext2_error(struct super_block *, const char *, const char *, ...);
+void ext2_error(struct super_block *sb, const char *function,
+ const char *fmt, ...);
extern __printf(3, 4)
-void ext2_msg(struct super_block *, const char *, const char *, ...);
-extern void ext2_update_dynamic_rev (struct super_block *sb);
+void ext2_msg(struct super_block *sb, const char *prefix,
+ const char *fmt, ...);
+extern void ext2_update_dynamic_rev(struct super_block *sb);
extern void ext2_sync_super(struct super_block *sb, struct ext2_super_block *es,
int wait);
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/file.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index 28b2609f25c1..3820b17241af 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -137,7 +137,7 @@ static int ext2_file_mmap(struct file *file, struct vm_area_struct *vma)
* for a single struct file are closed. Note that different open() calls
* for the same file yield different struct file structures.
*/
-static int ext2_release_file (struct inode * inode, struct file * filp)
+static int ext2_release_file(struct inode *inode, struct file *filp)
{
if (filp->f_mode & FMODE_WRITE) {
mutex_lock(&EXT2_I(inode)->truncate_mutex);
--
2.17.2
Fix various complains from checkpatch.pl
Signed-off-by: Chengguang Xu <[email protected]>
---
fs/ext2/xattr.c | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 62d9a659a8ff..7908ff3a1884 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -88,14 +88,15 @@
# define ea_bdebug(f...)
#endif
-static int ext2_xattr_set2(struct inode *, struct buffer_head *,
- struct ext2_xattr_header *);
-
-static int ext2_xattr_cache_insert(struct mb_cache *, struct buffer_head *);
-static struct buffer_head *ext2_xattr_cache_find(struct inode *,
- struct ext2_xattr_header *);
-static void ext2_xattr_rehash(struct ext2_xattr_header *,
- struct ext2_xattr_entry *);
+static int ext2_xattr_set2(struct inode *inode, struct buffer_head *old_bh,
+ struct ext2_xattr_header *header);
+
+static int ext2_xattr_cache_insert(struct mb_cache *cache,
+ struct buffer_head *bh);
+static struct buffer_head *ext2_xattr_cache_find(struct inode *inode,
+ struct ext2_xattr_header *header);
+static void ext2_xattr_rehash(struct ext2_xattr_header *header,
+ struct ext2_xattr_entry *entry);
static const struct xattr_handler *ext2_xattr_handler_map[] = {
[EXT2_XATTR_INDEX_USER] = &ext2_xattr_user_handler,
--
2.17.2
On 12/12/18 9:15 PM, Jan Kara wrote:
> On Tue 13-11-18 08:04:38, Chengguang Xu wrote:
>> This patch set fixes some coding style warnings which are from
>> checkpatch.pl.
>>
>> Detail warning/error messages are below:
>>
>> WARNING: function definition argument 'struct inode *' should
>> also have an identifier name
>>
>> WARNING: space prohibited between function name and open
>> parenthesis '('
>>
>> WARNING: line over 80 characters
>>
>> ERROR: "foo * bar" should be "foo *bar"
> Thanks for the series! I had a look into the patches but I don't think
> these whitespace fixes are really worth the churn. Sorry.
Hi Jan
Thanks for the check. The motivation of that series is just for avoiding
annoying checkpatch complains.
However, we can also fix the coding style problem when we actually
touch the particular code, that will be fine.
Thanks,
Chengguang
On Tue 13-11-18 08:04:38, Chengguang Xu wrote:
> This patch set fixes some coding style warnings which are from
> checkpatch.pl.
>
> Detail warning/error messages are below:
>
> WARNING: function definition argument 'struct inode *' should
> also have an identifier name
>
> WARNING: space prohibited between function name and open
> parenthesis '('
>
> WARNING: line over 80 characters
>
> ERROR: "foo * bar" should be "foo *bar"
Thanks for the series! I had a look into the patches but I don't think
these whitespace fixes are really worth the churn. Sorry.
Honza
--
Jan Kara <[email protected]>
SUSE Labs, CR