public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: al@alarsen.net
Cc: linux-kernel@vger.kernel.org
Subject: [2.6 patch] QNX4 cleanups
Date: Sat, 30 Oct 2004 20:07:02 +0200	[thread overview]
Message-ID: <20041030180702.GT4374@stusta.de> (raw)

The patch below does the following cleanups in the QNX4 fs:
- remove two unused global functions
- make some functions static


diffstat output:
 fs/qnx4/bitmap.c        |   58 ----------------------------------------
 fs/qnx4/inode.c         |    6 ++--
 include/linux/qnx4_fs.h |    4 --
 3 files changed, 4 insertions(+), 64 deletions(-)


Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6.10-rc1-mm2-full/include/linux/qnx4_fs.h.old	2004-10-30 14:53:54.000000000 +0200
+++ linux-2.6.10-rc1-mm2-full/include/linux/qnx4_fs.h	2004-10-30 15:01:34.000000000 +0200
@@ -114,15 +114,12 @@
 extern unsigned long qnx4_count_free_blocks(struct super_block *sb);
 extern unsigned long qnx4_block_map(struct inode *inode, long iblock);
 
-extern struct buffer_head *qnx4_getblk(struct inode *, int, int);
 extern struct buffer_head *qnx4_bread(struct inode *, int, int);
 
 extern struct inode_operations qnx4_file_inode_operations;
 extern struct inode_operations qnx4_dir_inode_operations;
 extern struct file_operations qnx4_file_operations;
 extern struct file_operations qnx4_dir_operations;
-extern int qnx4_is_free(struct super_block *sb, long block);
-extern int qnx4_set_bitmap(struct super_block *sb, long block, int busy);
 extern int qnx4_create(struct inode *inode, struct dentry *dentry, int mode, struct nameidata *nd);
 extern void qnx4_truncate(struct inode *inode);
 extern void qnx4_free_inode(struct inode *inode);
@@ -130,7 +127,6 @@
 extern int qnx4_rmdir(struct inode *dir, struct dentry *dentry);
 extern int qnx4_sync_file(struct file *file, struct dentry *dentry, int);
 extern int qnx4_sync_inode(struct inode *inode);
-extern int qnx4_get_block(struct inode *inode, sector_t iblock, struct buffer_head *bh, int create);
 
 static inline struct qnx4_sb_info *qnx4_sb(struct super_block *sb)
 {
--- linux-2.6.10-rc1-mm2-full/fs/qnx4/inode.c.old	2004-10-30 14:58:16.000000000 +0200
+++ linux-2.6.10-rc1-mm2-full/fs/qnx4/inode.c	2004-10-30 15:01:28.000000000 +0200
@@ -162,7 +162,7 @@
 	return 0;
 }
 
-struct buffer_head *qnx4_getblk(struct inode *inode, int nr,
+static struct buffer_head *qnx4_getblk(struct inode *inode, int nr,
 				 int create)
 {
 	struct buffer_head *result = NULL;
@@ -212,7 +212,7 @@
 	return NULL;
 }
 
-int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_head *bh, int create )
+static int qnx4_get_block( struct inode *inode, sector_t iblock, struct buffer_head *bh, int create )
 {
 	unsigned long phys;
 
@@ -447,7 +447,7 @@
 {
 	return generic_block_bmap(mapping,block,qnx4_get_block);
 }
-struct address_space_operations qnx4_aops = {
+static struct address_space_operations qnx4_aops = {
 	.readpage	= qnx4_readpage,
 	.writepage	= qnx4_writepage,
 	.sync_page	= block_sync_page,
--- linux-2.6.10-rc1-mm2-full/fs/qnx4/bitmap.c.old	2004-10-30 14:49:21.000000000 +0200
+++ linux-2.6.10-rc1-mm2-full/fs/qnx4/bitmap.c	2004-10-30 14:57:34.000000000 +0200
@@ -28,7 +28,7 @@
 	return 0;
 }
 
-void count_bits(register const char *bmPart, register int size,
+static void count_bits(register const char *bmPart, register int size,
 		int *const tf)
 {
 	char b;
@@ -85,62 +85,6 @@
 
 #ifdef CONFIG_QNX4FS_RW
 
-int qnx4_is_free(struct super_block *sb, long block)
-{
-	int start = le32_to_cpu(qnx4_sb(sb)->BitMap->di_first_xtnt.xtnt_blk) - 1;
-	int size = le32_to_cpu(qnx4_sb(sb)->BitMap->di_size);
-	struct buffer_head *bh;
-	const char *g;
-	int ret = -EIO;
-
-	start += block / (QNX4_BLOCK_SIZE * 8);
-	QNX4DEBUG(("qnx4: is_free requesting block [%lu], bitmap in block [%lu]\n",
-		   (unsigned long) block, (unsigned long) start));
-	(void) size;		/* CHECKME */
-	bh = sb_bread(sb, start);
-	if (bh == NULL) {
-		return -EIO;
-	}
-	g = bh->b_data + (block % QNX4_BLOCK_SIZE);
-	if (((*g) & (1 << (block % 8))) == 0) {
-		QNX4DEBUG(("qnx4: is_free -> block is free\n"));
-		ret = 1;
-	} else {
-		QNX4DEBUG(("qnx4: is_free -> block is busy\n"));
-		ret = 0;
-	}
-	brelse(bh);
-
-	return ret;
-}
-
-int qnx4_set_bitmap(struct super_block *sb, long block, int busy)
-{
-	int start = le32_to_cpu(qnx4_sb(sb)->BitMap->di_first_xtnt.xtnt_blk) - 1;
-	int size = le32_to_cpu(qnx4_sb(sb)->BitMap->di_size);
-	struct buffer_head *bh;
-	char *g;
-
-	start += block / (QNX4_BLOCK_SIZE * 8);
-	QNX4DEBUG(("qnx4: set_bitmap requesting block [%lu], bitmap in block [%lu]\n",
-		   (unsigned long) block, (unsigned long) start));
-	(void) size;		/* CHECKME */
-	bh = sb_bread(sb, start);
-	if (bh == NULL) {
-		return -EIO;
-	}
-	g = bh->b_data + (block % QNX4_BLOCK_SIZE);
-	if (busy == 0) {
-		(*g) &= ~(1 << (block % 8));
-	} else {
-		(*g) |= (1 << (block % 8));
-	}
-	mark_buffer_dirty(bh);
-	brelse(bh);
-
-	return 0;
-}
-
 static void qnx4_clear_inode(struct inode *inode)
 {
 	struct qnx4_inode_entry *qnx4_ino = qnx4_raw_inode(inode);


             reply	other threads:[~2004-10-30 18:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-30 18:07 Adrian Bunk [this message]
2004-10-30 18:34 ` [2.6 patch] QNX4 cleanups Al Viro
2004-10-30 19:01   ` Anders Larsen
2004-10-30 21:22     ` [2.6 patch] mark QNX4FS_RW as BROKEN Adrian Bunk
2004-10-30 21:55       ` Anders Larsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041030180702.GT4374@stusta.de \
    --to=bunk@stusta.de \
    --cc=al@alarsen.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox