Changes by: antona
Update of /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs
In directory usw-pr-cvs1:/tmp/cvs-serv21775/linux/fs/ntfs
Modified Files:
dir.c
Log Message:
More updates. Getting there. All is done except for looking through merge_run_list and helpers.
Index: dir.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfs-driver-tng/linux/fs/ntfs/dir.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -U2 -r1.42 -r1.43
--- dir.c 10 Feb 2002 02:22:58 -0000 1.42
+++ dir.c 10 Feb 2002 04:31:06 -0000 1.43
@@ -1,3 +1,3 @@
-/*
+/**
* dir.c - NTFS kernel directory operations. Part of the Linux-NTFS project.
*
@@ -22,5 +22,7 @@
#include "ntfs.h"
-/* The little endian Unicode string $I30 as a global constant. */
+/**
+ * The little endian Unicode string $I30 as a global constant.
+ */
const uchar_t I30[5] = { const_cpu_to_le16('$'), const_cpu_to_le16('I'),
const_cpu_to_le16('3'), const_cpu_to_le16('0'),
@@ -56,5 +58,5 @@
INDEX_ENTRY *ie;
INDEX_ALLOCATION *ia;
- char *index_end;
+ u8 *index_end;
u64 mref;
attr_search_context *ctx;
@@ -64,5 +66,5 @@
struct address_space *ia_mapping;
struct page *page;
- char *kaddr;
+ u8 *kaddr;
/* Get hold of the mft record for the directory. */
@@ -85,9 +87,9 @@
}
/* Get to the index root value (it's been verified in read_inode). */
- ir = (INDEX_ROOT*)((char*)ctx->attr +
+ ir = (INDEX_ROOT*)((u8*)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
- index_end = (char*)&ir->index + le32_to_cpu(ir->index.index_length);
+ index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
- ie = (INDEX_ENTRY*)((char*)&ir->index +
+ ie = (INDEX_ENTRY*)((u8*)&ir->index +
le32_to_cpu(ir->index.entries_offset));
/*
@@ -95,9 +97,9 @@
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((char*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds checks. */
- if ((char*)ie < (char*)ctx->mrec || (char*)ie +
+ if ((u8*)ie < (u8*)ctx->mrec || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (char*)ie + le16_to_cpu(ie->key_length) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end)
goto dir_err_out;
@@ -193,5 +195,5 @@
}
/* Get the starting vcn of the index_block holding the child node. */
- vcn = sle64_to_cpup((char*)ie + le16_to_cpu(ie->length) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
ia_mapping = VFS_I(dir_ni)->i_mapping;
descend_into_child_node:
@@ -208,5 +210,5 @@
goto put_unm_err_out;
}
- kaddr = (char*)page_address(page);
+ kaddr = (u8*)page_address(page);
fast_descend_into_child_node:
/* Get to the index allocation block. */
@@ -214,5 +216,5 @@
~PAGE_CACHE_MASK));
/* Bounds checks. */
- if ((char*)ia < kaddr || (char*)ia > kaddr + PAGE_CACHE_SIZE) {
+ if ((u8*)ia < kaddr || (u8*)ia > kaddr + PAGE_CACHE_SIZE) {
ntfs_error(sb, "Out of bounds check failed. Corrupt directory "
"inode %Li or driver bug.",
@@ -244,5 +246,5 @@
goto unm_unm_err_out;
}
- index_end = (char*)ia + dir_ni->index_block_size;
+ index_end = (u8*)ia + dir_ni->index_block_size;
if (index_end > kaddr + PAGE_CACHE_SIZE) {
ntfs_error(sb, "Index buffer (VCN %Li) of directory inode %Li "
@@ -254,6 +256,6 @@
goto unm_unm_err_out;
}
- index_end = (char*)&ia->index + le32_to_cpu(ia->index.index_length);
- if (index_end > (char*)ia + dir_ni->index_block_size) {
+ index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
+ if (index_end > (u8*)ia + dir_ni->index_block_size) {
ntfs_error(sb, "Size of index buffer (VCN %Li) of directory "
"inode %Li exceeds maximum size.",
@@ -264,5 +266,5 @@
}
/* The first index entry. */
- ie = (INDEX_ENTRY*)((char*)&ia->index +
+ ie = (INDEX_ENTRY*)((u8*)&ia->index +
le32_to_cpu(ia->index.entries_offset));
/*
@@ -271,9 +273,9 @@
* reach the last entry.
*/
- for (;; ie = (INDEX_ENTRY*)((char*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
/* Bounds check. */
- if ((char*)ie < (char*)ia || (char*)ie +
+ if ((u8*)ie < (u8*)ia || (u8*)ie +
sizeof(INDEX_ENTRY_HEADER) > index_end ||
- (char*)ie + le16_to_cpu(ie->key_length) >
+ (u8*)ie + le16_to_cpu(ie->key_length) >
index_end) {
ntfs_error(sb, "Index entry out of bounds in "
@@ -370,5 +372,5 @@
/* Child node present, descend into it. */
old_vcn = vcn;
- vcn = sle64_to_cpup((char*)ie + le16_to_cpu(ie->length) - 8);
+ vcn = sle64_to_cpup((u8*)ie + le16_to_cpu(ie->length) - 8);
if (vcn >= 0) {
/* If vcn is in the same page cache page as old_vcn we
@@ -425,5 +427,5 @@
static inline int ntfs_filldir(ntfs_volume *vol, struct file *filp,
ntfs_inode *ndir, const INDEX_TYPE index_type,
- index_union iu, INDEX_ENTRY *ie, unsigned char *name,
+ index_union iu, INDEX_ENTRY *ie, u8 *name,
void *dirent, filldir_t filldir)
{
@@ -486,5 +488,5 @@
INDEX_ENTRY *ie;
INDEX_ALLOCATION *ia;
- unsigned char *name;
+ u8 *name;
int rc, err, ir_pos, bmp_pos;
struct address_space *ia_mapping;
@@ -536,5 +538,5 @@
* converted to format determined by current NLS.
*/
- name = (unsigned char*)kmalloc(NTFS_MAX_NAME_LEN * 3 + 1, GFP_NOFS);
+ name = (u8*)kmalloc(NTFS_MAX_NAME_LEN * 3 + 1, GFP_NOFS);
if (!name) {
err = -ENOMEM;
@@ -556,9 +558,9 @@
/* FIXME: Clean up search context. */
/* Get to the index root value (it's been verified in read_inode). */
- ir = (INDEX_ROOT*)((char*)ctx->attr +
+ ir = (INDEX_ROOT*)((u8*)ctx->attr +
le16_to_cpu(ctx->attr->value_offset));
- index_end = (char*)&ir->index + le32_to_cpu(ir->index.index_length);
+ index_end = (u8*)&ir->index + le32_to_cpu(ir->index.index_length);
/* The first index entry. */
- ie = (INDEX_ENTRY*)((char*)&ir->index +
+ ie = (INDEX_ENTRY*)((u8*)&ir->index +
le32_to_cpu(ir->index.entries_offset));
/*
@@ -567,5 +569,5 @@
* or signals an error (both covered by the rc test).
*/
- for (;; ie = (INDEX_ENTRY*)((char*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
ntfs_debug("In index root, offset 0x%x.\n", (u8*)ie - (u8*)ir);
/* Bounds checks. */
@@ -579,5 +581,5 @@
break;
/* Skip index root entry if continuing previous readdir. */
- if (ir_pos > (char*)ie - (char*)ir)
+ if (ir_pos > (u8*)ie - (u8*)ir)
continue;
/* Submit the name to the filldir callback. */
@@ -702,5 +704,5 @@
}
ia_start = ia_pos & ~(s64)(ndir->index_block_size - 1);
- index_end = (char*)&ia->index + le32_to_cpu(ia->index.index_length);
+ index_end = (u8*)&ia->index + le32_to_cpu(ia->index.index_length);
if (index_end > (u8*)ia + ndir->index_block_size) {
ntfs_error(sb, "Size of index buffer (VCN %Li) of directory "
@@ -712,5 +714,5 @@
}
/* The first index entry in this index buffer. */
- ie = (INDEX_ENTRY*)((char*)&ia->index +
+ ie = (INDEX_ENTRY*)((u8*)&ia->index +
le32_to_cpu(ia->index.entries_offset));
/*
@@ -719,5 +721,5 @@
* or signals an error (both covered by the rc test).
*/
- for (;; ie = (INDEX_ENTRY*)((char*)ie + le16_to_cpu(ie->length))) {
+ for (;; ie = (INDEX_ENTRY*)((u8*)ie + le16_to_cpu(ie->length))) {
ntfs_debug("In index allocation, offset 0x%Lx.\n",
(long long)ia_start + ((u8*)ie - (u8*)ia));
@@ -732,5 +734,5 @@
break;
/* Skip index block entry if continuing previous readdir. */
- if (ia_pos - ia_start > (char*)ie - (char*)ia)
+ if (ia_pos - ia_start > (u8*)ie - (u8*)ia)
continue;
/* Submit the name to the filldir callback. */
@@ -780,20 +782,6 @@
struct file_operations ntfs_dir_ops = {
- llseek: NULL, /* . */
read: generic_read_dir, /* Return -EISDIR. */
- write: NULL, /* . */
readdir: ntfs_readdir, /* Read directory. */
- poll: NULL, /* . */
- ioctl: NULL, /* . */
- open: NULL, /* . */
- flush: NULL, /* . */
- release: NULL, /* . */
- fsync: NULL, /* . */
- fasync: NULL, /* . */
- lock: NULL, /* . */
- readv: NULL, /* . */
- writev: NULL, /* . */
- sendpage: NULL, /* . */
- get_unmapped_area: NULL, /* . */
};
@@ -802,5 +790,4 @@
* kernel lock held in all filesystems. */
struct file_operations {
- struct module *owner;
loff_t (*llseek) (struct file *, loff_t, int);
ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
|