patch-2.2.7 linux/fs/ntfs/fs.c

Next file: linux/fs/ntfs/inode.c
Previous file: linux/fs/nls/Config.in
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.6/linux/fs/ntfs/fs.c linux/fs/ntfs/fs.c
@@ -215,7 +215,6 @@
 
 	ntfs_debug(DEBUG_OTHER, "ntfs_readdir ino %x mode %x\n",
 	       (unsigned)dir->i_ino,(unsigned int)dir->i_mode);
-	if(!dir || (dir->i_ino==0) || !S_ISDIR(dir->i_mode))return -EBADF;
 
 	ntfs_debug(DEBUG_OTHER, "readdir: Looking for file %x dircount %d\n",
 	       (unsigned)filp->f_pos,dir->i_count);
@@ -373,7 +372,7 @@
 	return 0;
 }
 			
-static int ntfs_lookup(struct inode *dir, struct dentry *d)
+static struct dentry *ntfs_lookup(struct inode *dir, struct dentry *d)
 {
 	struct inode *res=0;
 	char *item=0;
@@ -385,10 +384,10 @@
 	error=ntfs_decodeuni(NTFS_INO2VOL(dir),(char*)d->d_name.name,
 			     d->d_name.len,&walk.name,&walk.namelen);
 	if(error)
-		return error;
+		return ERR_PTR(-error);
 	item=ntfs_malloc(ITEM_SIZE);
 	if( !item )
-		return ENOMEM;
+		return ERR_PTR(-ENOMEM);
 	/* ntfs_getdir will place the directory entry into item,
 	   and the first long long is the MFT record number */
 	walk.type=BY_NAME;
@@ -402,7 +401,7 @@
 	ntfs_free(item);
 	ntfs_free(walk.name);
 	/* Always return success, the dcache will handle negative entries. */
-	return 0;
+	return NULL;
 }
 
 static struct file_operations ntfs_file_operations_nommap = {
@@ -829,7 +828,7 @@
 
 	error = ntfs_get_volumesize( NTFS_SB2VOL( sb ), &fs.f_blocks );
 	if( error )
-		return error;
+		return -error;
 	fs.f_bfree=ntfs_get_free_cluster_count(vol->bitmap);
 	fs.f_bavail=fs.f_bfree;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)