public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] QNX4 cleanups
@ 2004-10-30 18:07 Adrian Bunk
  2004-10-30 18:34 ` Al Viro
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2004-10-30 18:07 UTC (permalink / raw)
  To: al; +Cc: linux-kernel

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);


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] QNX4 cleanups
  2004-10-30 18:07 [2.6 patch] QNX4 cleanups Adrian Bunk
@ 2004-10-30 18:34 ` Al Viro
  2004-10-30 19:01   ` Anders Larsen
  0 siblings, 1 reply; 5+ messages in thread
From: Al Viro @ 2004-10-30 18:34 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: al, linux-kernel

On Sat, Oct 30, 2004 at 08:07:02PM +0200, Adrian Bunk wrote:
> The patch below does the following cleanups in the QNX4 fs:
> - remove two unused global functions
> - make some functions static

How about you read the code before doing that?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] QNX4 cleanups
  2004-10-30 18:34 ` Al Viro
@ 2004-10-30 19:01   ` Anders Larsen
  2004-10-30 21:22     ` [2.6 patch] mark QNX4FS_RW as BROKEN Adrian Bunk
  0 siblings, 1 reply; 5+ messages in thread
From: Anders Larsen @ 2004-10-30 19:01 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Al Viro, linux-kernel

On Sat, Oct 30, 2004 at 08:07:02PM +0200, Adrian Bunk wrote:
> The patch below does the following cleanups in the QNX4 fs:
> - remove two unused global functions

If you remove any code inside the #ifdef CONFIG_QNX4FS_RW we might
as well remove the option "config QNX4FS_RW" altogether.
It's horribly broken, and I don't intend to fix it; while I was
thinking about how to properly implement write-support, somebody else
went away and did it. As that alternative seems to work well and is
being actively maintained, I won't try to reinvent it.

Cheers
 Anders



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [2.6 patch] mark QNX4FS_RW as BROKEN
  2004-10-30 19:01   ` Anders Larsen
@ 2004-10-30 21:22     ` Adrian Bunk
  2004-10-30 21:55       ` Anders Larsen
  0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2004-10-30 21:22 UTC (permalink / raw)
  To: Anders Larsen; +Cc: Al Viro, linux-kernel

On Sat, Oct 30, 2004 at 07:01:28PM +0000, Anders Larsen wrote:
> On Sat, Oct 30, 2004 at 08:07:02PM +0200, Adrian Bunk wrote:
> >The patch below does the following cleanups in the QNX4 fs:
> >- remove two unused global functions
> 
> If you remove any code inside the #ifdef CONFIG_QNX4FS_RW we might
> as well remove the option "config QNX4FS_RW" altogether.
> It's horribly broken, and I don't intend to fix it; while I was
> thinking about how to properly implement write-support, somebody else
> went away and did it. As that alternative seems to work well and is
> being actively maintained, I won't try to reinvent it.


OK, I understand why my patch wasn't good.

What about the following to mark it as BROKEN in the Kconfig file?


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

--- linux-2.6.10-rc1-mm2-full/fs/Kconfig.old	2004-10-30 23:15:17.000000000 +0200
+++ linux-2.6.10-rc1-mm2-full/fs/Kconfig	2004-10-30 23:15:34.000000000 +0200
@@ -1353,7 +1353,7 @@
 
 config QNX4FS_RW
 	bool "QNX4FS write support (DANGEROUS)"
-	depends on QNX4FS_FS && EXPERIMENTAL
+	depends on QNX4FS_FS && EXPERIMENTAL && BROKEN
 	help
 	  Say Y if you want to test write support for QNX4 file systems.
 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [2.6 patch] mark QNX4FS_RW as BROKEN
  2004-10-30 21:22     ` [2.6 patch] mark QNX4FS_RW as BROKEN Adrian Bunk
@ 2004-10-30 21:55       ` Anders Larsen
  0 siblings, 0 replies; 5+ messages in thread
From: Anders Larsen @ 2004-10-30 21:55 UTC (permalink / raw)
  To: Adrian Bunk; +Cc: Al Viro, linux-kernel

On 2004-10-30 23:22:50, Adrian Bunk wrote:
> What about the following to mark it as BROKEN in the Kconfig file?

OK



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-10-30 21:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-30 18:07 [2.6 patch] QNX4 cleanups Adrian Bunk
2004-10-30 18:34 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox