Commit 0e856c92 authored by Anton Altaparmakov's avatar Anton Altaparmakov

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.
parent ad571243
...@@ -247,6 +247,12 @@ ChangeLog ...@@ -247,6 +247,12 @@ ChangeLog
Note, a technical ChangeLog aimed at kernel hackers is in fs/ntfs/ChangeLog. 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: 2.0.8:
- Remove now obsolete show_inodes and posix mount option(s). - Remove now obsolete show_inodes and posix mount option(s).
- Restore show_sys_files mount option. - Restore show_sys_files mount option.
......
...@@ -23,6 +23,17 @@ ToDo: ...@@ -23,6 +23,17 @@ ToDo:
them cleaner and make code reuse easier. them cleaner and make code reuse easier.
- Want to use dummy inodes for address space i/o. - 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. 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 Big thanks go to Al Viro and other inhabitants of #kernel for investing
......
...@@ -5,7 +5,7 @@ obj-$(CONFIG_NTFS_FS) += ntfs.o ...@@ -5,7 +5,7 @@ obj-$(CONFIG_NTFS_FS) += ntfs.o
ntfs-objs := aops.o attrib.o compress.o debug.o dir.o file.o inode.o mft.o \ 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 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) ifeq ($(CONFIG_NTFS_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG EXTRA_CFLAGS += -DDEBUG
......
...@@ -50,11 +50,13 @@ typedef enum { ...@@ -50,11 +50,13 @@ typedef enum {
} ntfs_compression_constants; } 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; 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; static spinlock_t ntfs_cb_lock = SPIN_LOCK_UNLOCKED;
/** /**
...@@ -66,8 +68,6 @@ static spinlock_t ntfs_cb_lock = SPIN_LOCK_UNLOCKED; ...@@ -66,8 +68,6 @@ static spinlock_t ntfs_cb_lock = SPIN_LOCK_UNLOCKED;
*/ */
int allocate_compression_buffers(void) int allocate_compression_buffers(void)
{ {
int i, j;
BUG_ON(ntfs_compression_buffer); BUG_ON(ntfs_compression_buffer);
ntfs_compression_buffer = vmalloc(NTFS_MAX_CB_SIZE); ntfs_compression_buffer = vmalloc(NTFS_MAX_CB_SIZE);
...@@ -83,8 +83,6 @@ int allocate_compression_buffers(void) ...@@ -83,8 +83,6 @@ int allocate_compression_buffers(void)
*/ */
void free_compression_buffers(void) void free_compression_buffers(void)
{ {
int i;
BUG_ON(!ntfs_compression_buffer); BUG_ON(!ntfs_compression_buffer);
vfree(ntfs_compression_buffer); vfree(ntfs_compression_buffer);
ntfs_compression_buffer = NULL; ntfs_compression_buffer = NULL;
...@@ -592,7 +590,8 @@ int ntfs_file_read_compressed_block(struct page *page) ...@@ -592,7 +590,8 @@ int ntfs_file_read_compressed_block(struct page *page)
/* /*
* Get the compression buffer. We must not sleep any more * 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); spin_lock(&ntfs_cb_lock);
cb = ntfs_compression_buffer; cb = ntfs_compression_buffer;
...@@ -668,7 +667,10 @@ int ntfs_file_read_compressed_block(struct page *page) ...@@ -668,7 +667,10 @@ int ntfs_file_read_compressed_block(struct page *page)
if (page) if (page)
memset(page_address(page) + cur_ofs, 0, memset(page_address(page) + cur_ofs, 0,
cb_max_ofs - cur_ofs); 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; cur_ofs = cb_max_ofs;
} }
} else if (vcn == start_vcn) { } else if (vcn == start_vcn) {
...@@ -742,7 +744,8 @@ int ntfs_file_read_compressed_block(struct page *page) ...@@ -742,7 +744,8 @@ int ntfs_file_read_compressed_block(struct page *page)
cb_pos, cb_size - (cb_pos - cb)); cb_pos, cb_size - (cb_pos - cb));
/* /*
* We can sleep from now on, lock already dropped by * We can sleep from now on, lock already dropped by
* ntfs_decompress. */ * ntfs_decompress().
*/
if (err) { if (err) {
ntfs_error(vol->sb, "ntfs_decompress() failed in inode " ntfs_error(vol->sb, "ntfs_decompress() failed in inode "
"0x%Lx with error code %i. Skipping " "0x%Lx with error code %i. Skipping "
......
...@@ -995,10 +995,10 @@ typedef enum { ...@@ -995,10 +995,10 @@ typedef enum {
* @ie: current index entry * @ie: current index entry
* @name: buffer to use for the converted name * @name: buffer to use for the converted name
* @dirent: vfs filldir callback context * @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 * Convert the Unicode @name to the loaded NLS and pass it to the @filldir
* the filldir callback. * callback.
*/ */
static inline int ntfs_filldir(ntfs_volume *vol, struct file *filp, static inline int ntfs_filldir(ntfs_volume *vol, struct file *filp,
ntfs_inode *ndir, const INDEX_TYPE index_type, ntfs_inode *ndir, const INDEX_TYPE index_type,
...@@ -1033,7 +1033,7 @@ static inline int ntfs_filldir(ntfs_volume *vol, struct file *filp, ...@@ -1033,7 +1033,7 @@ static inline int ntfs_filldir(ntfs_volume *vol, struct file *filp,
} }
name_len = ntfs_ucstonls(vol, (uchar_t*)&ie->key.file_name.file_name, name_len = ntfs_ucstonls(vol, (uchar_t*)&ie->key.file_name.file_name,
ie->key.file_name.file_name_length, &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) { if (name_len <= 0) {
ntfs_debug("Skipping unrepresentable file."); ntfs_debug("Skipping unrepresentable file.");
return 0; return 0;
...@@ -1126,7 +1126,8 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir) ...@@ -1126,7 +1126,8 @@ static int ntfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
* Allocate a buffer to store the current name being processed * Allocate a buffer to store the current name being processed
* converted to format determined by current NLS. * 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) { if (!name) {
err = -ENOMEM; err = -ENOMEM;
goto put_unm_err_out; goto put_unm_err_out;
......
...@@ -948,8 +948,7 @@ typedef struct { ...@@ -948,8 +948,7 @@ typedef struct {
data attribute. NOTE: Is a multiple data attribute. NOTE: Is a multiple
of the cluster size. */ of the cluster size. */
/* 30*/ s64 data_size; /* Byte size of actual data in data /* 30*/ s64 data_size; /* Byte size of actual data in data
attribute. NOTE: Only present when attribute. */
lowest_vcn is 0. */
/* 38*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */ /* 38*/ FILE_ATTR_FLAGS file_attributes; /* Flags describing the file. */
/* 3c*/ union { /* 3c*/ union {
/* 3c*/ struct { /* 3c*/ struct {
......
...@@ -235,8 +235,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent) ...@@ -235,8 +235,9 @@ static struct dentry *ntfs_lookup(struct inode *dir_ino, struct dentry *dent)
} }
nls_name.hash = full_name_hash(nls_name.name, nls_name.len); 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? */ /* Does a dentry matching the nls_name exist already? */
real_dent = d_lookup(dent->d_parent, &nls_name); real_dent = d_lookup(dent->d_parent, &nls_name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment