http://linux-ntfs.bkbits.net/ntfs-2.6 aia21@cantab.net|ChangeSet|20040521082503|22617 aia21 # This is a BitKeeper generated diff -Nru style patch. # # ChangeSet # 2004/05/17 22:45:04+01:00 aia21@cantab.net # 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. # # fs/ntfs/ntfs.h # 2004/05/17 22:42:28+01:00 aia21@cantab.net +1 -0 # Add a new address space operations struct, ntfs_mst_aops, for mst # protected attributes. # # fs/ntfs/inode.c # 2004/05/17 22:42:15+01:00 aia21@cantab.net +5 -2 # Add a new address space operations struct, ntfs_mst_aops, for mst # protected attributes. # # fs/ntfs/aops.c # 2004/05/17 22:41:44+01:00 aia21@cantab.net +9 -0 # Add a new address space operations struct, ntfs_mst_aops, for mst # protected attributes. # # fs/ntfs/Makefile # 2004/05/17 22:41:38+01:00 aia21@cantab.net +1 -1 # Update # # fs/ntfs/ChangeLog # 2004/05/17 22:41:31+01:00 aia21@cantab.net +8 -0 # Update # diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog --- a/fs/ntfs/ChangeLog Fri May 21 19:02:40 2004 +++ b/fs/ntfs/ChangeLog Fri May 21 19:02:40 2004 @@ -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 Fri May 21 19:02:40 2004 +++ b/fs/ntfs/Makefile Fri May 21 19:02:40 2004 @@ -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 Fri May 21 19:02:40 2004 +++ b/fs/ntfs/aops.c Fri May 21 19:02:40 2004 @@ -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 Fri May 21 19:02:40 2004 +++ b/fs/ntfs/inode.c Fri May 21 19:02:40 2004 @@ -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 Fri May 21 19:02:40 2004 +++ b/fs/ntfs/ntfs.h Fri May 21 19:02:40 2004 @@ -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;