[LWN Logo]
[LWN.net]
From:	 Anton Altaparmakov <aia21@cantab.net>
To:	 linux-kernel@vger.kernel.org (Linux Kernel)
Subject: [PATCH] NTFS 2.0.7 release (small cleanup)
Date:	 Sat, 11 May 2002 16:10:17 +0100 (BST)
Cc:	 linux-ntfs-dev@lists.sf.net

Hi all, I just submitted this patch updating ntfs to 2.0.7 to Linus
for inclusion. Patch is also available from the ntfs bitkeeper tree:
	bk://linux-ntfs.bkbits.net/ntfs-tng-2.5

This will update the following files:

 fs/ntfs/ChangeLog  |    9 +++
 fs/ntfs/Makefile   |    2 
 fs/ntfs/aops.c     |    6 --
 fs/ntfs/attraops.c |    1 
 fs/ntfs/file.c     |  120 +----------------------------------------------------
 fs/ntfs/mft.c      |    9 ---
 fs/ntfs/namei.c    |   37 ----------------
 fs/ntfs/ntfs.h     |    9 ---
 fs/ntfs/super.c    |   32 +++++---------
 9 files changed, 26 insertions(+), 199 deletions(-)

through these ChangeSets:

<aia21@cantab.net> (02/05/11 1.539)
   NTFS 2.0.7 release: pure cleanups.

<aia21@cantab.net> (02/05/11 1.513.26.1)
   NTFS 2.0.7: minor cleanup, remove NULL struct initializers


diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog	Sat May 11 16:06:22 2002
+++ b/fs/ntfs/ChangeLog	Sat May 11 16:06:22 2002
@@ -28,6 +28,10 @@
 
 	- Remove much of the NULL struct element initializers.
 	- Various updates to make compatible with recent kernels.
+	- Remove defines of MAX_BUF_PER_PAGE and include linux/buffer_head.h
+	  in fs/ntfs/ntfs.h instead.
+	- Remove no longer needed KERNEL_VERSION checks. We are now in the
+	  kernel proper so they are no longer needed.
 
 2.0.6 - Major bugfix to make compatible with other kernel changes.
 
diff -Nru a/fs/ntfs/aops.c b/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c	Sat May 11 16:06:22 2002
+++ b/fs/ntfs/aops.c	Sat May 11 16:06:22 2002
@@ -29,12 +29,6 @@
 
 #include "ntfs.h"
 
-#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,8)
-#define page_buffers(page)	(page)->buffers
-#endif
-
 /**
  * end_buffer_read_file_async -
  *
diff -Nru a/fs/ntfs/mft.c b/fs/ntfs/mft.c
--- a/fs/ntfs/mft.c	Sat May 11 16:06:22 2002
+++ b/fs/ntfs/mft.c	Sat May 11 16:06:22 2002
@@ -25,8 +25,6 @@
 
 #include "ntfs.h"
 
-#define MAX_BUF_PER_PAGE (PAGE_CACHE_SIZE / 512)
-
 /**
  * __format_mft_record - initialize an empty mft record
  * @m:		mapped, pinned and locked for writing mft record
diff -Nru a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
--- a/fs/ntfs/ntfs.h	Sat May 11 16:06:22 2002
+++ b/fs/ntfs/ntfs.h	Sat May 11 16:06:22 2002
@@ -26,14 +26,11 @@
 
 #include <linux/version.h>
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,5)
-#	error The NTFS driver requires at least kernel 2.5.5.
-#endif
-
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/compiler.h>
 #include <linux/fs.h>
+#include <linux/buffer_head.h>
 #include <linux/nls.h>
 #include <linux/pagemap.h>
 #include <linux/smp.h>
@@ -48,10 +45,6 @@
 #include "layout.h"
 #include "attrib.h"
 #include "mft.h"
-
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
-typedef long sector_t;
-#endif
 
 typedef enum {
 	NTFS_BLOCK_SIZE		= 512,
diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/ChangeLog	Sat May 11 16:06:23 2002
@@ -24,6 +24,11 @@
 	- Want to use dummy inodes for address space i/o. We need some VFS
 	  changes first, which are currently under discussion.
 
+2.0.7 - Minor cleanups and updates for changes in core kernel code.
+
+	- Remove much of the NULL struct element initializers.
+	- Various updates to make compatible with recent kernels.
+
 2.0.6 - Major bugfix to make compatible with other kernel changes.
 
 	- Initialize the mftbmp address space properly now that there are more
diff -Nru a/fs/ntfs/Makefile b/fs/ntfs/Makefile
--- a/fs/ntfs/Makefile	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/Makefile	Sat May 11 16:06:23 2002
@@ -7,7 +7,7 @@
 
 obj-m   := $(O_TARGET)
 
-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.6\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.7\"
 
 ifeq ($(CONFIG_NTFS_DEBUG),y)
 EXTRA_CFLAGS += -DDEBUG
diff -Nru a/fs/ntfs/attraops.c b/fs/ntfs/attraops.c
--- a/fs/ntfs/attraops.c	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/attraops.c	Sat May 11 16:06:23 2002
@@ -43,6 +43,5 @@
 						   disk request queue. */
 	prepare_write:	NULL,			/* . */
 	commit_write:	NULL,			/* . */
-	//truncatepage:	NULL,			/* . */
 };
 
diff -Nru a/fs/ntfs/file.c b/fs/ntfs/file.c
--- a/fs/ntfs/file.c	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/file.c	Sat May 11 16:06:23 2002
@@ -24,127 +24,13 @@
 struct file_operations ntfs_file_ops = {
 	llseek:			generic_file_llseek,	/* Seek inside file. */
 	read:			generic_file_read,	/* Read from file. */
-	write:			NULL,			/* . */
-	readdir:		NULL,			/* . */
-	poll:			NULL,			/* . */
-	ioctl:			NULL,			/* . */
 	mmap:			generic_file_mmap,	/* Mmap file. */
 	open:			generic_file_open,	/* Open file. */
-	flush:			NULL,			/* . */
-	release:		NULL,			/* . */
-	fsync:			NULL,			/* . */
-	fasync:			NULL,			/* . */
-	lock:			NULL,			/* . */
-	readv:			NULL,			/* . */
-	writev:			NULL,			/* . */
-	sendpage:		NULL,			/* . */
-	get_unmapped_area:	NULL,			/* . */
 };
 
-struct inode_operations ntfs_file_inode_ops = {
-	create:		NULL,		/* . */
-	lookup:		NULL,		/* . */
-	link:		NULL,		/* . */
-	unlink:		NULL,		/* . */
-	symlink:	NULL,		/* . */
-	mkdir:		NULL,		/* . */
-	rmdir:		NULL,		/* . */
-	mknod:		NULL,		/* . */
-	rename:		NULL,		/* . */
-	readlink:	NULL,		/* . */
-	follow_link:	NULL,		/* . */
-	truncate:	NULL,		/* . */
-	permission:	NULL,		/* . */
-	revalidate:	NULL,		/* . */
-	setattr:	NULL,		/* . */
-	getattr:	NULL,		/* . */
-};
-
-#if 0
-/* NOTE: read, write, poll, fsync, readv, writev can be called without the big
- * kernel lock held in all filesystems. */
-struct file_operations {
-	struct module *owner;
-	loff_t (*llseek) (struct file *, loff_t, int);
-	ssize_t (*read) (struct file *, char *, size_t, loff_t *);
-	ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
-	int (*readdir) (struct file *, void *, filldir_t);
-	unsigned int (*poll) (struct file *, struct poll_table_struct *);
-	int (*ioctl) (struct inode *, struct file *, unsigned int,
-			unsigned long);
-	int (*mmap) (struct file *, struct vm_area_struct *);
-	int (*flush) (struct file *);
-	int (*release) (struct inode *, struct file *);
-	int (*fsync) (struct file *, struct dentry *, int datasync);
-	int (*fasync) (int, struct file *, int);
-	int (*lock) (struct file *, int, struct file_lock *);
-	ssize_t (*readv) (struct file *, const struct iovec *, unsigned long,
-			loff_t *);
-	ssize_t (*writev) (struct file *, const struct iovec *, unsigned long,
-			loff_t *);
-	ssize_t (*sendpage) (struct file *, struct page *, int, size_t,
-			loff_t *, int);
-	unsigned long (*get_unmapped_area)(struct file *, unsigned long,
-			unsigned long, unsigned long, unsigned long);
-};
+struct inode_operations ntfs_file_inode_ops = {};
 
-struct inode_operations {
-	int (*create) (struct inode *,struct dentry *,int);
-	struct dentry * (*lookup) (struct inode *,struct dentry *);
-	int (*link) (struct dentry *,struct inode *,struct dentry *);
-	int (*unlink) (struct inode *,struct dentry *);
-	int (*symlink) (struct inode *,struct dentry *,const char *);
-	int (*mkdir) (struct inode *,struct dentry *,int);
-	int (*rmdir) (struct inode *,struct dentry *);
-	int (*mknod) (struct inode *,struct dentry *,int,int);
-	int (*rename) (struct inode *, struct dentry *,
-			struct inode *, struct dentry *);
-	int (*readlink) (struct dentry *, char *,int);
-	int (*follow_link) (struct dentry *, struct nameidata *);
-	void (*truncate) (struct inode *);
-	int (*permission) (struct inode *, int);
-	int (*revalidate) (struct dentry *);
-	int (*setattr) (struct dentry *, struct iattr *);
-	int (*getattr) (struct dentry *, struct iattr *);
-};
-#endif
+struct file_operations ntfs_empty_file_ops = {};
 
-struct file_operations ntfs_empty_file_ops = {
-	llseek:			NULL,			/* . */
-	read:			NULL,			/* . */
-	write:			NULL,			/* . */
-	readdir:		NULL,			/* . */
-	poll:			NULL,			/* . */
-	ioctl:			NULL,			/* . */
-	mmap:			NULL,			/* . */
-	open:			NULL,			/* . */
-	flush:			NULL,			/* . */
-	release:		NULL,			/* . */
-	fsync:			NULL,			/* . */
-	fasync:			NULL,			/* . */
-	lock:			NULL,			/* . */
-	readv:			NULL,			/* . */
-	writev:			NULL,			/* . */
-	sendpage:		NULL,			/* . */
-	get_unmapped_area:	NULL,			/* . */
-};
-
-struct inode_operations ntfs_empty_inode_ops = {
-	create:		NULL,		/* . */
-	lookup:		NULL,		/* . */
-	link:		NULL,		/* . */
-	unlink:		NULL,		/* . */
-	symlink:	NULL,		/* . */
-	mkdir:		NULL,		/* . */
-	rmdir:		NULL,		/* . */
-	mknod:		NULL,		/* . */
-	rename:		NULL,		/* . */
-	readlink:	NULL,		/* . */
-	follow_link:	NULL,		/* . */
-	truncate:	NULL,		/* . */
-	permission:	NULL,		/* . */
-	revalidate:	NULL,		/* . */
-	setattr:	NULL,		/* . */
-	getattr:	NULL,		/* . */
-};
+struct inode_operations ntfs_empty_inode_ops = {};
 
diff -Nru a/fs/ntfs/mft.c b/fs/ntfs/mft.c
--- a/fs/ntfs/mft.c	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/mft.c	Sat May 11 16:06:23 2002
@@ -114,13 +114,6 @@
 						   disk request queue. */
 	prepare_write:	NULL,			/* . */
 	commit_write:	NULL,			/* . */
-	bmap:		NULL,			/* Needed for FIBMAP.
-						   Don't use it. */
-	flushpage:	NULL,			/* . */
-	releasepage:	NULL,			/* . */
-#ifdef KERNEL_HAS_O_DIRECT
-	direct_IO:	NULL,			/* . */
-#endif
 };
 
 /**
diff -Nru a/fs/ntfs/namei.c b/fs/ntfs/namei.c
--- a/fs/ntfs/namei.c	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/namei.c	Sat May 11 16:06:23 2002
@@ -103,43 +103,6 @@
 }
 
 struct inode_operations ntfs_dir_inode_ops = {
-	create:		NULL,		/* . */
 	lookup:		ntfs_lookup,	/* lookup directory. */
-	link:		NULL,		/* . */
-	unlink:		NULL,		/* . */
-	symlink:	NULL,		/* . */
-	mkdir:		NULL,		/* . */
-	rmdir:		NULL,		/* . */
-	mknod:		NULL,		/* . */
-	rename:		NULL,		/* . */
-	readlink:	NULL,		/* . */
-	follow_link:	NULL,		/* . */
-	truncate:	NULL,		/* . */
-	permission:	NULL,		/* . */
-	revalidate:	NULL,		/* . */
-	setattr:	NULL,		/* . */
-	getattr:	NULL,		/* . */
 };
-
-#if 0
-struct inode_operations {
-	int (*create) (struct inode *,struct dentry *,int);
-	struct dentry * (*lookup) (struct inode *,struct dentry *);
-	int (*link) (struct dentry *,struct inode *,struct dentry *);
-	int (*unlink) (struct inode *,struct dentry *);
-	int (*symlink) (struct inode *,struct dentry *,const char *);
-	int (*mkdir) (struct inode *,struct dentry *,int);
-	int (*rmdir) (struct inode *,struct dentry *);
-	int (*mknod) (struct inode *,struct dentry *,int,int);
-	int (*rename) (struct inode *, struct dentry *,
-			struct inode *, struct dentry *);
-	int (*readlink) (struct dentry *, char *,int);
-	int (*follow_link) (struct dentry *, struct nameidata *);
-	void (*truncate) (struct inode *);
-	int (*permission) (struct inode *, int);
-	int (*revalidate) (struct dentry *);
-	int (*setattr) (struct dentry *, struct iattr *);
-	int (*getattr) (struct dentry *, struct iattr *);
-};
-#endif
 
diff -Nru a/fs/ntfs/super.c b/fs/ntfs/super.c
--- a/fs/ntfs/super.c	Sat May 11 16:06:23 2002
+++ b/fs/ntfs/super.c	Sat May 11 16:06:23 2002
@@ -1424,31 +1424,23 @@
 						   called from iget(). */
 	dirty_inode:	ntfs_dirty_inode,	/* VFS: Called from
 						   __mark_inode_dirty(). */
-	write_inode:	NULL,		/* VFS: Write dirty inode to disk. */
-	put_inode:	NULL,		/* VFS: Called whenever the reference
-					   count (i_count) of the inode is
-					   going to be decreased but before the
-					   actual decrease. */
-	delete_inode:	NULL,		/* VFS: Delete inode from disk. Called
-					   when i_count becomes 0 and i_nlink is
-					   also 0. */
+	//write_inode:	NULL,		/* VFS: Write dirty inode to disk. */
+	//put_inode:	NULL,		/* VFS: Called whenever the reference
+	//				   count (i_count) of the inode is
+	//				   going to be decreased but before the
+	//				   actual decrease. */
+	//delete_inode:	NULL,		/* VFS: Delete inode from disk. Called
+	//				   when i_count becomes 0 and i_nlink is
+	//				   also 0. */
 	put_super:	ntfs_put_super,	/* Syscall: umount. */
-	write_super:	NULL,		/* Flush dirty super block to disk. */
-	write_super_lockfs:	NULL,	/* ? */
-	unlockfs:	NULL,		/* ? */
+	//write_super:	NULL,		/* Flush dirty super block to disk. */
+	//write_super_lockfs:	NULL,	/* ? */
+	//unlockfs:	NULL,		/* ? */
 	statfs:		ntfs_statfs,	/* Syscall: statfs */
 	remount_fs:	ntfs_remount,	/* Syscall: mount -o remount. */
 	clear_inode:	ntfs_clear_big_inode,	/* VFS: Called when an inode is
 						   removed from memory. */
-	umount_begin:	NULL,		/* Forced umount. */
-	/*
-	 * These are NFSd support functions but NTFS is a standard fs so
-	 * shouldn't need to implement these manually. At least we can try
-	 * without and if it doesn't work in some way we can always implement
-	 * something here.
-	 */
-	fh_to_dentry:	NULL,		/* Get dentry for given file handle. */
-	dentry_to_fh:	NULL,		/* Get file handle for given dentry. */
+	//umount_begin:	NULL,		/* Forced umount. */
 	show_options:	ntfs_show_options, /* Show mount options in proc. */
 };
 

Best regards,

	Anton
-- 
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/

===================================================================

This BitKeeper patch contains the following changesets:
aia21@cantab.net|ChangeSet|20020511140008|01977
aia21@cantab.net|ChangeSet|20020511112351|01997
aia21@cantab.net|ChangeSet|20020511110827|41648
## Wrapped with gzip_uu ##


[2. application/octet-stream; bkpatch17542]...

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/