[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200416000653.37696-1-paulmcquad@gmail.com>
Date: Thu, 16 Apr 2020 01:06:53 +0100
From: Paul McQuade <paulmcquad@...il.com>
To: linux-kernel@...r.kernel.org
Cc: Paul McQuade <paulmcquad@...il.com>
Subject: [PATCH] fs: minix: Fixed styles
Removed whitespaces and a bit of styling
Signed-off-by: Paul McQuade <paulmcquad@...il.com>
---
fs/minix/bitmap.c | 42 +++++++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 19 deletions(-)
diff --git a/fs/minix/bitmap.c b/fs/minix/bitmap.c
index f4e5e5181a14..90ff9597d024 100644
--- a/fs/minix/bitmap.c
+++ b/fs/minix/bitmap.c
@@ -22,9 +22,11 @@ static DEFINE_SPINLOCK(bitmap_lock);
/*
* bitmap consists of blocks filled with 16bit words
* bit set == busy, bit clear == free
- * endianness is a mess, but for counting zero bits it really doesn't matter...
+ * endianness is a mess, but for counting zero
+ * it really doesn't matter...
*/
-static __u32 count_free(struct buffer_head *map[], unsigned blocksize, __u32 numbits)
+static __u32 count_free(struct buffer_head *map[], unsigned int blocksize,
+ __u32 numbits)
{
__u32 sum = 0;
unsigned blocks = DIV_ROUND_UP(numbits, blocksize * 8);
@@ -52,7 +54,7 @@ void minix_free_block(struct inode *inode, unsigned long block)
return;
}
zone = block - sbi->s_firstdatazone + 1;
- bit = zone & ((1<<k) - 1);
+ bit = zone & ((1 << k) - 1);
zone >>= k;
if (zone >= sbi->s_zmap_blocks) {
printk("minix_free_block: nonexistent bitmap buffer\n");
@@ -68,7 +70,7 @@ void minix_free_block(struct inode *inode, unsigned long block)
return;
}
-int minix_new_block(struct inode * inode)
+int minix_new_block(struct inode *inode)
{
struct minix_sb_info *sbi = minix_sb(inode->i_sb);
int bits_per_zone = 8 * inode->i_sb->s_blocksize;
@@ -84,7 +86,7 @@ int minix_new_block(struct inode * inode)
minix_set_bit(j, bh->b_data);
spin_unlock(&bitmap_lock);
mark_buffer_dirty(bh);
- j += i * bits_per_zone + sbi->s_firstdatazone-1;
+ j += i * bits_per_zone + sbi->s_firstdatazone - 1;
if (j < sbi->s_firstdatazone || j >= sbi->s_nzones)
break;
return j;
@@ -103,8 +105,8 @@ unsigned long minix_count_free_blocks(struct super_block *sb)
<< sbi->s_log_zone_size);
}
-struct minix_inode *
-minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
+struct minix_inode *minix_V1_raw_inode(struct super_block *sb, ino_t ino,
+ struct buffer_head **bh)
{
int block;
struct minix_sb_info *sbi = minix_sb(sb);
@@ -117,7 +119,7 @@ minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
}
ino--;
block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
- ino / MINIX_INODES_PER_BLOCK;
+ ino / MINIX_INODES_PER_BLOCK;
*bh = sb_bread(sb, block);
if (!*bh) {
printk("Unable to read inode block\n");
@@ -127,13 +129,14 @@ minix_V1_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
return p + ino % MINIX_INODES_PER_BLOCK;
}
-struct minix2_inode *
-minix_V2_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
+struct minix2_inode *minix_V2_raw_inode(struct super_block *sb, ino_t ino,
+ struct buffer_head **bh)
{
int block;
struct minix_sb_info *sbi = minix_sb(sb);
struct minix2_inode *p;
- int minix2_inodes_per_block = sb->s_blocksize / sizeof(struct minix2_inode);
+ int minix2_inodes_per_block =
+ sb->s_blocksize / sizeof(struct minix2_inode);
*bh = NULL;
if (!ino || ino > sbi->s_ninodes) {
@@ -143,7 +146,7 @@ minix_V2_raw_inode(struct super_block *sb, ino_t ino, struct buffer_head **bh)
}
ino--;
block = 2 + sbi->s_imap_blocks + sbi->s_zmap_blocks +
- ino / minix2_inodes_per_block;
+ ino / minix2_inodes_per_block;
*bh = sb_bread(sb, block);
if (!*bh) {
printk("Unable to read inode block\n");
@@ -176,11 +179,11 @@ static void minix_clear_inode(struct inode *inode)
}
if (bh) {
mark_buffer_dirty(bh);
- brelse (bh);
+ brelse(bh);
}
}
-void minix_free_inode(struct inode * inode)
+void minix_free_inode(struct inode *inode)
{
struct super_block *sb = inode->i_sb;
struct minix_sb_info *sbi = minix_sb(inode->i_sb);
@@ -193,14 +196,14 @@ void minix_free_inode(struct inode * inode)
printk("minix_free_inode: inode 0 or nonexistent inode\n");
return;
}
- bit = ino & ((1<<k) - 1);
+ bit = ino & ((1 << k) - 1);
ino >>= k;
if (ino >= sbi->s_imap_blocks) {
printk("minix_free_inode: nonexistent imap in superblock\n");
return;
}
- minix_clear_inode(inode); /* clear on-disk copy */
+ minix_clear_inode(inode); /* clear on-disk copy */
bh = sbi->s_imap[ino];
spin_lock(&bitmap_lock);
@@ -210,12 +213,13 @@ void minix_free_inode(struct inode * inode)
mark_buffer_dirty(bh);
}
-struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error)
+struct inode *minix_new_inode(const struct inode *dir,
+ umode_t mode, int *error)
{
struct super_block *sb = dir->i_sb;
struct minix_sb_info *sbi = minix_sb(sb);
struct inode *inode = new_inode(sb);
- struct buffer_head * bh;
+ struct buffer_head *bh;
int bits_per_zone = 8 * sb->s_blocksize;
unsigned long j;
int i;
@@ -239,7 +243,7 @@ struct inode *minix_new_inode(const struct inode *dir, umode_t mode, int *error)
iput(inode);
return NULL;
}
- if (minix_test_and_set_bit(j, bh->b_data)) { /* shouldn't happen */
+ if (minix_test_and_set_bit(j, bh->b_data)) { /* shouldn't happen */
spin_unlock(&bitmap_lock);
printk("minix_new_inode: bit already set\n");
iput(inode);
--
2.26.0
Powered by blists - more mailing lists