Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 945ffe54 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Linus Torvalds
Browse files

qnx4: remove write support



qnx4 wrte support has never been fully implement, is broken since the dawn
of time and hasn't been actively developed since before git history
started.

Instead of letting it further bitrot and complicate API transition (like
the new truncate code) remove it.

Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Cc: Anders Larsen <al@alarsen.net>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8a9f47dd
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -6,20 +6,9 @@ config QNX4FS_FS
	  QNX 4 and QNX 6 (the latter is also called QNX RTP).
	  Further information is available at <http://www.qnx.com/>.
	  Say Y if you intend to mount QNX hard disks or floppies.
	  Unless you say Y to "QNX4FS read-write support" below, you will
	  only be able to read these file systems.

	  To compile this file system support as a module, choose M here: the
	  module will be called qnx4.

	  If you don't know whether you need it, then you don't need it:
	  answer N.

config QNX4FS_RW
	bool "QNX4FS write support (DANGEROUS)"
	depends on QNX4FS_FS && EXPERIMENTAL && BROKEN
	help
	  Say Y if you want to test write support for QNX4 file systems.

	  It's currently broken, so for now:
	  answer N.
+1 −1
Original line number Diff line number Diff line
@@ -4,4 +4,4 @@

obj-$(CONFIG_QNX4FS_FS) += qnx4.o

qnx4-objs := inode.o dir.o namei.o file.o bitmap.o truncate.o
qnx4-objs := inode.o dir.o namei.o bitmap.o
+0 −81
Original line number Diff line number Diff line
@@ -78,84 +78,3 @@ unsigned long qnx4_count_free_blocks(struct super_block *sb)

	return total_free;
}

#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);
	/* What for? */
	memset(qnx4_ino->di_fname, 0, sizeof qnx4_ino->di_fname);
	qnx4_ino->di_size = 0;
	qnx4_ino->di_num_xtnts = 0;
	qnx4_ino->di_mode = 0;
	qnx4_ino->di_status = 0;
}

void qnx4_free_inode(struct inode *inode)
{
	if (inode->i_ino < 1) {
		printk("free_inode: inode 0 or nonexistent inode\n");
		return;
	}
	qnx4_clear_inode(inode);
	clear_inode(inode);
}

#endif
+0 −5
Original line number Diff line number Diff line
@@ -85,9 +85,4 @@ const struct file_operations qnx4_dir_operations =
const struct inode_operations qnx4_dir_inode_operations =
{
	.lookup		= qnx4_lookup,
#ifdef CONFIG_QNX4FS_RW
	.create		= qnx4_create,
	.unlink		= qnx4_unlink,
	.rmdir		= qnx4_rmdir,
#endif
};

fs/qnx4/file.c

deleted100644 → 0
+0 −40
Original line number Diff line number Diff line
/*
 * QNX4 file system, Linux implementation.
 *
 * Version : 0.2.1
 *
 * Using parts of the xiafs filesystem.
 *
 * History :
 *
 * 25-05-1998 by Richard Frowijn : first release.
 * 21-06-1998 by Frank Denis : wrote qnx4_readpage to use generic_file_read.
 * 27-06-1998 by Frank Denis : file overwriting.
 */

#include "qnx4.h"

/*
 * We have mostly NULL's here: the current defaults are ok for
 * the qnx4 filesystem.
 */
const struct file_operations qnx4_file_operations =
{
	.llseek		= generic_file_llseek,
	.read		= do_sync_read,
	.aio_read	= generic_file_aio_read,
	.mmap		= generic_file_mmap,
	.splice_read	= generic_file_splice_read,
#ifdef CONFIG_QNX4FS_RW
	.write		= do_sync_write,
	.aio_write	= generic_file_aio_write,
	.fsync		= simple_fsync,
#endif
};

const struct inode_operations qnx4_file_inode_operations =
{
#ifdef CONFIG_QNX4FS_RW
	.truncate	= qnx4_truncate,
#endif
};
Loading