patch-2.2.7 linux/fs/hpfs/hpfs_fs.c

Next file: linux/fs/inode.c
Previous file: linux/fs/hfs/dir_nat.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.6/linux/fs/hpfs/hpfs_fs.c linux/fs/hpfs/hpfs_fs.c
@@ -192,7 +192,7 @@
 			     size_t count, loff_t *ppos);
 static int hpfs_readdir(struct file *filp,
 			void *dirent, filldir_t filldir);
-static int hpfs_lookup(struct inode *, struct dentry *);
+static struct dentry *hpfs_lookup(struct inode *, struct dentry *);
 
 static const struct file_operations hpfs_dir_ops =
 {
@@ -1119,7 +1119,7 @@
  * the boondocks.)
  */
 
-static int hpfs_lookup(struct inode *dir, struct dentry *dentry)
+static struct dentry *hpfs_lookup(struct inode *dir, struct dentry *dentry)
 {
 	const char *name = dentry->d_name.name;
 	int len = dentry->d_name.len;
@@ -1129,14 +1129,6 @@
 	int retval;
 	struct quad_buffer_head qbh;
 
-	/* In case of madness */
-
-	retval = -ENOTDIR;
-	if (dir == 0)
-		goto out;
-	if (!S_ISDIR(dir->i_mode))
-		goto out;
-
 	/*
 	 * Read in the directory entry. "." is there under the name ^A^A .
 	 * Always read the dir even for . and .. in case we need the dates.
@@ -1208,7 +1200,7 @@
 	brelse4(&qbh);
 
       out:
-	return retval;
+	return ERR_PTR(retval);
 }
 
 /*
@@ -1373,11 +1365,6 @@
 	char * tempname;
 	long old_pos;
 	struct inode *inode = filp->f_dentry->d_inode;
-
-	if (inode == 0
-	    || inode->i_sb == 0
-	    || !S_ISDIR(inode->i_mode))
-		return -EBADF;
 
 	tempname = (char *) __get_free_page(GFP_KERNEL);
 	if (!tempname)

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