[2.6.7-rc1-bk] NTFS: 2.1.12 release - patch 1/3

From: Anton Altaparmakov
Date: Wed May 26 2004 - 16:19:31 EST


This is patch 1 in the series. It contains the following ChangeSet:

<aia21@xxxxxxxxxx> (04/05/17 1.1717.9.1)
NTFS: Add a new address space operations struct, ntfs_mst_aops, for mst
protected attributes. This is because the default ntfs_aops do not
make sense with mst protected data and were they to write anything to
such an attribute they would cause data corruption so we provide
ntfs_mst_aops which does not have any write related operations set.

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/, http://www-stu.christs.cam.ac.uk/~aia21/

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

diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog 2004-05-26 22:10:11 +01:00
+++ b/fs/ntfs/ChangeLog 2004-05-26 22:10:11 +01:00
@@ -25,6 +25,14 @@
sufficient for synchronisation here. We then just need to make sure
ntfs_readpage/writepage/truncate interoperate properly with us.

+2.1.12 - WIP.
+
+ - Add a new address space operations struct, ntfs_mst_aops, for mst
+ protected attributes. This is because the default ntfs_aops do not
+ make sense with mst protected data and were they to write anything to
+ such an attribute they would cause data corruption so we provide
+ ntfs_mst_aops which does not have any write related operations set.
+
2.1.11 - Driver internal cleanups.

- Only build logfile.o if building the driver with read-write support.
diff -Nru a/fs/ntfs/Makefile b/fs/ntfs/Makefile
--- a/fs/ntfs/Makefile 2004-05-26 22:10:11 +01:00
+++ b/fs/ntfs/Makefile 2004-05-26 22:10:11 +01:00
@@ -5,7 +5,7 @@
ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \
mst.o namei.o super.o sysctl.o unistr.o upcase.o

-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.11\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.1.12-WIP\"

ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
diff -Nru a/fs/ntfs/aops.c b/fs/ntfs/aops.c
--- a/fs/ntfs/aops.c 2004-05-26 22:10:11 +01:00
+++ b/fs/ntfs/aops.c 2004-05-26 22:10:11 +01:00
@@ -1788,3 +1788,12 @@
#endif
};

+/**
+ * ntfs_mst_aops - general address space operations for mst protecteed inodes
+ * and attributes
+ */
+struct address_space_operations ntfs_mst_aops = {
+ .readpage = ntfs_readpage, /* Fill page with data. */
+ .sync_page = block_sync_page, /* Currently, just unplugs the
+ disk request queue. */
+};
diff -Nru a/fs/ntfs/inode.c b/fs/ntfs/inode.c
--- a/fs/ntfs/inode.c 2004-05-26 22:10:11 +01:00
+++ b/fs/ntfs/inode.c 2004-05-26 22:10:11 +01:00
@@ -872,7 +872,7 @@
/* Setup the operations for this inode. */
vi->i_op = &ntfs_dir_inode_ops;
vi->i_fop = &ntfs_dir_ops;
- vi->i_mapping->a_ops = &ntfs_aops;
+ vi->i_mapping->a_ops = &ntfs_mst_aops;
} else {
/* It is a file. */
reinit_attr_search_ctx(ctx);
@@ -1249,7 +1249,10 @@
/* Setup the operations for this attribute inode. */
vi->i_op = NULL;
vi->i_fop = NULL;
- vi->i_mapping->a_ops = &ntfs_aops;
+ if (NInoMstProtected(ni))
+ vi->i_mapping->a_ops = &ntfs_mst_aops;
+ else
+ vi->i_mapping->a_ops = &ntfs_aops;

if (!NInoCompressed(ni))
vi->i_blocks = ni->allocated_size >> 9;
diff -Nru a/fs/ntfs/ntfs.h b/fs/ntfs/ntfs.h
--- a/fs/ntfs/ntfs.h 2004-05-26 22:10:11 +01:00
+++ b/fs/ntfs/ntfs.h 2004-05-26 22:10:11 +01:00
@@ -62,6 +62,7 @@
/* The various operations structs defined throughout the driver files. */
extern struct super_operations ntfs_sops;
extern struct address_space_operations ntfs_aops;
+extern struct address_space_operations ntfs_mst_aops;
extern struct address_space_operations ntfs_mft_aops;

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