2002-06-19 10:33:29

by Anton Altaparmakov

[permalink] [raw]
Subject: [2.5-BK-PATCH] NTFS 2.0.9 update

Linus, please do a

bk pull http://linux-ntfs.bkbits.net/ntfs-tng-2.5

Thanks! This is a small update to ntfs, mostly just to remove the compile
warnings generated by the now unused variables after Rusty Russell's changes.
And a few other bits and pieces (just cleanups).

The only code change is a micro optimization in the decompression engine
(thanks to Rusty for spotting it).

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 will update the following files:

Documentation/filesystems/ntfs.txt | 6 ++++++
fs/ntfs/ChangeLog | 13 ++++++++++++-
fs/ntfs/Makefile | 2 +-
fs/ntfs/compress.c | 21 ++++++++++++---------
fs/ntfs/dir.c | 11 ++++++-----
fs/ntfs/layout.h | 3 +--
fs/ntfs/namei.c | 5 +++--
7 files changed, 41 insertions(+), 20 deletions(-)

through these ChangeSets:

<[email protected]> (02/06/19 1.548)
NTFS: 2.0.9 release. Decompression engine now uses a single buffer and other cleanups.
- Remove unused variables left over after Rusty's patch to the decompression
engine.
- Change buffer size in ntfs_readdir()/ntfs_filldir() to use
NLS_MAX_CHARSET_SIZE.
- Miscellaneous minor cleanups to comments.

<[email protected]> (02/06/19 1.549)
NTFS: Fix typo.


diff -Nru a/Documentation/filesystems/ntfs.txt b/Documentation/filesystems/ntfs.txt
--- a/Documentation/filesystems/ntfs.txt Wed Jun 19 11:27:29 2002
+++ b/Documentation/filesystems/ntfs.txt Wed Jun 19 11:27:29 2002
@@ -247,6 +247,12 @@

Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog.

+2.0.9:
+ - Change decompression engine to use a single buffer. This should not
+ affect performance except perhaps on the most heavy i/o on SMP
+ systems when accessing multiple compressed files from multiple
+ devices simultaneously.
+ - Minor updates and cleanups.
2.0.8:
- Remove now obsolete show_inodes and posix mount option(s).
- Restore show_sys_files mount option.
diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog Wed Jun 19 11:27:29 2002
+++ b/fs/ntfs/ChangeLog Wed Jun 19 11:27:29 2002
@@ -23,6 +23,17 @@
them cleaner and make code reuse easier.
- Want to use dummy inodes for address space i/o.

+2.0.9 - Decompression engine now uses a single buffer and other cleanups.
+
+ - Change decompression engine to use a single buffer protected by a
+ spin lock instead of per-CPU buffers. (Rusty Russel)
+ - Switch to using the new KM_BIO_SRC_IRQ for atomic kmaps. (Andrew
+ Morton)
+ - Change buffer size in ntfs_readdir()/ntfs_filldir() to use
+ NLS_MAX_CHARSET_SIZE which makes the buffers almost 1kiB each but
+ it also makes everything safer so it is a good thing.
+ - Miscellaneous minor cleanups to comments.
+
2.0.8 - Major updates for handling of case sensitivity and dcache aliasing.

Big thanks go to Al Viro and other inhabitants of #kernel for investing
diff -Nru a/fs/ntfs/Makefile b/fs/ntfs/Makefile
--- a/fs/ntfs/Makefile Wed Jun 19 11:27:29 2002
+++ b/fs/ntfs/Makefile Wed Jun 19 11:27:29 2002
@@ -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 time.o unistr.o upcase.o

-EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.8\"
+EXTRA_CFLAGS = -DNTFS_VERSION=\"2.0.9\"

ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
diff -Nru a/fs/ntfs/compress.c b/fs/ntfs/compress.c
--- a/fs/ntfs/compress.c Wed Jun 19 11:27:29 2002
+++ b/fs/ntfs/compress.c Wed Jun 19 11:27:29 2002
@@ -50,11 +50,13 @@
} ntfs_compression_constants;

/**
- * ntfs_compression_buffer - one buffer for the decompression engine.
+ * ntfs_compression_buffer - one buffer for the decompression engine
*/
static u8 *ntfs_compression_buffer = NULL;

-/* This spinlock which protects it */
+/**
+ * ntfs_cb_lock - spinlock which protects ntfs_compression_buffer
+ */
static spinlock_t ntfs_cb_lock = SPIN_LOCK_UNLOCKED;

/**
@@ -66,8 +68,6 @@
*/
int allocate_compression_buffers(void)
{
- int i, j;
-
BUG_ON(ntfs_compression_buffer);

ntfs_compression_buffer = vmalloc(NTFS_MAX_CB_SIZE);
@@ -83,8 +83,6 @@
*/
void free_compression_buffers(void)
{
- int i;
-
BUG_ON(!ntfs_compression_buffer);
vfree(ntfs_compression_buffer);
ntfs_compression_buffer = NULL;
@@ -592,7 +590,8 @@

/*
* Get the compression buffer. We must not sleep any more
- * until we are finished with it. */
+ * until we are finished with it.
+ */
spin_lock(&ntfs_cb_lock);
cb = ntfs_compression_buffer;

@@ -668,7 +667,10 @@
if (page)
memset(page_address(page) + cur_ofs, 0,
cb_max_ofs - cur_ofs);
- cb_pos += cb_max_ofs - cur_ofs;
+ /*
+ * No need to update cb_pos at this stage:
+ * cb_pos += cb_max_ofs - cur_ofs;
+ */
cur_ofs = cb_max_ofs;
}
} else if (vcn == start_vcn) {
@@ -742,7 +744,8 @@
cb_pos, cb_size - (cb_pos - cb));
/*
* We can sleep from now on, lock already dropped by
- * ntfs_decompress. */
+ * ntfs_decompress().
+ */
if (err) {
ntfs_error(vol->sb, "ntfs_decompress() failed in inode "
"0x%Lx with error code %i. Skipping "
diff -Nru a/fs/ntfs/dir.c b/fs/ntfs/dir.c
--- a/fs/ntfs/dir.c Wed Jun 19 11:27:29 2002
+++ b/fs/ntfs/dir.c Wed Jun 19 11:27:29 2002
@@ -995,10 +995,10 @@
* @ie: current index entry
* @name: buffer to use for the converted name
* @dirent: vfs filldir callback context
- * filldir: vfs filldir callback
+ * @filldir: vfs filldir callback
*
- * Convert the Unicode name to the loaded NLS and pass it to
- * the filldir callback.
+ * Convert the Unicode @name to the loaded NLS and pass it to the @filldir
+ * callback.
*/
static inline int ntfs_filldir(ntfs_volume *vol, struct file *filp,
ntfs_inode *ndir, const INDEX_TYPE index_type,
@@ -1033,7 +1033,7 @@
}
name_len = ntfs_ucstonls(vol, (uchar_t*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, &name,
- NTFS_MAX_NAME_LEN * 3 + 1);
+ NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1);
if (name_len <= 0) {
ntfs_debug("Skipping unrepresentable file.");
return 0;
@@ -1126,7 +1126,8 @@
* Allocate a buffer to store the current name being processed
* converted to format determined by current NLS.
*/
- name = (u8*)kmalloc(NTFS_MAX_NAME_LEN * 3 + 1, GFP_NOFS);
+ name = (u8*)kmalloc(NTFS_MAX_NAME_LEN * NLS_MAX_CHARSET_SIZE + 1,
+ GFP_NOFS);
if (!name) {
err = -ENOMEM;
goto put_unm_err_out;
diff -Nru a/fs/ntfs/layout.h b/fs/ntfs/layout.h
--- a/fs/ntfs/layout.h Wed Jun 19 11:27:29 2002
+++ b/fs/ntfs/layout.h Wed Jun 19 11:27:29 2002
@@ -948,8 +948,7 @@
data attribute. NOTE: Is a multiple
of the cluster size. */
/* 30*/ s64 data_size; /* Byte size of actual data in data
- attribute. NOTE: Only present when
- lowest_vcn is 0. */
+ attribute. */
/* 38*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */
/* 3c*/ union {
/* 3c*/ struct {
diff -Nru a/fs/ntfs/namei.c b/fs/ntfs/namei.c
--- a/fs/ntfs/namei.c Wed Jun 19 11:27:29 2002
+++ b/fs/ntfs/namei.c Wed Jun 19 11:27:29 2002
@@ -235,8 +235,9 @@
}
nls_name.hash = full_name_hash(nls_name.name, nls_name.len);

- // FIXME: Do we need dcache_lock or dparent_lock here or is the
- // fact that i_sem is held on the parent inode sufficient? (AIA)
+ /*
+ * Note: No need for dparent_lock as i_sem is held on the parent inode.
+ */

/* Does a dentry matching the nls_name exist already? */
real_dent = d_lookup(dent->d_parent, &nls_name);
diff -Nru a/fs/ntfs/ChangeLog b/fs/ntfs/ChangeLog
--- a/fs/ntfs/ChangeLog Wed Jun 19 11:27:30 2002
+++ b/fs/ntfs/ChangeLog Wed Jun 19 11:27:30 2002
@@ -26,7 +26,7 @@
2.0.9 - Decompression engine now uses a single buffer and other cleanups.

- Change decompression engine to use a single buffer protected by a
- spin lock instead of per-CPU buffers. (Rusty Russel)
+ spin lock instead of per-CPU buffers. (Rusty Russell)
- Switch to using the new KM_BIO_SRC_IRQ for atomic kmaps. (Andrew
Morton)
- Change buffer size in ntfs_readdir()/ntfs_filldir() to use

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

This BitKeeper patch contains the following changesets:
[email protected]|ChangeSet|20020619102354|24989
[email protected]|ChangeSet|20020619094853|24993
[email protected]|ChangeSet|20020619080624|25748
[email protected]|ChangeSet|20020618221226|05503
[email protected]|ChangeSet|20020612170720|56511
[email protected]|ChangeSet|20020610011304|45406
[email protected]|ChangeSet|20020609060851|25935
[email protected]|ChangeSet|20020606195445|09279
[email protected]|ChangeSet|20020605191906|36417
[email protected]|ChangeSet|20020603073201|20682
## Wrapped with gzip_uu ##


begin 664 bkpatch17656
M'XL(`))<$#T``]U::6_;2!+]+/V*QLR'S;&B^^0U\,*.[<P8B9VLG0P&BP!"
MBVQ)A"E2X&''"_[XK6Y2DG4P(\G18"=Q(.I@57?7J^-523^CRW._4Z39O8S#
M_$06XSA-K"*323Y1A;2"=%*=C64R4K>JJ"C&%/X$<1@6=D5LS)TJ("$ADA,5
M8LI=FW=_1I]SE?D=&4E*X-5O:5[XG4`FA1Q8B2K@K9LTA;>.RCP[RK/@J$A&
M77CWHRR",;I76>YWB,7F[Q2/4^5W;BY^_?S^]*;;/3Y&\RVAX^/N]]W]7-LX
MG:AOZ[(QPX1Q02N"'0=WSQ&Q.&$6L0C"]`C;1Y@A[/J,^IB\QL3'&!FCG"R,
M@5YCU,/=-^C[GN*L&Z`KE8T46BSES^T]N(NCI/S:HY9`45*D&V_2H$1K^UW=
MB:`>Q<3#;L6%YXAM)!C!!'L4K$8YV4;"QH3`@3&N.(7UNN\0O.?2[M7.DA\7
MGM/M[?BOV^T6691$)W<J2U1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