summaryrefslogtreecommitdiffstats
path: root/fs/qnx4
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
committerRalf Baechle <ralf@linux-mips.org>1999-06-13 16:29:25 +0000
commitdb7d4daea91e105e3859cf461d7e53b9b77454b2 (patch)
tree9bb65b95440af09e8aca63abe56970dd3360cc57 /fs/qnx4
parent9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff)
Merge with Linux 2.2.8.
Diffstat (limited to 'fs/qnx4')
-rw-r--r--fs/qnx4/dir.c3
-rw-r--r--fs/qnx4/file.c2
-rw-r--r--fs/qnx4/namei.c28
3 files changed, 9 insertions, 24 deletions
diff --git a/fs/qnx4/dir.c b/fs/qnx4/dir.c
index 119930667..029fd9061 100644
--- a/fs/qnx4/dir.c
+++ b/fs/qnx4/dir.c
@@ -35,9 +35,6 @@ static int qnx4_readdir(struct file *filp, void *dirent, filldir_t filldir)
blknum = inode->u.qnx4_i.i_first_xtnt.xtnt_blk - 1 +
((filp->f_pos >> 6) >> 3);
- if (!inode || !inode->i_sb || !S_ISDIR(inode->i_mode)) {
- return -EBADF;
- }
QNX4DEBUG(("qnx4_readdir:i_size = %ld\n", (long) inode->i_size));
QNX4DEBUG(("filp->f_pos = %ld\n", (long) filp->f_pos));
QNX4DEBUG(("BlkNum = %ld\n", (long) blknum));
diff --git a/fs/qnx4/file.c b/fs/qnx4/file.c
index 499980126..ab923b7f0 100644
--- a/fs/qnx4/file.c
+++ b/fs/qnx4/file.c
@@ -33,8 +33,6 @@
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))
-#include <linux/fs.h>
-#include <linux/qnx4_fs.h>
static int qnx4_readpage(struct file *file, struct page *page);
diff --git a/fs/qnx4/namei.c b/fs/qnx4/namei.c
index 267ecb110..feb014b8e 100644
--- a/fs/qnx4/namei.c
+++ b/fs/qnx4/namei.c
@@ -70,12 +70,8 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
struct buffer_head *bh;
*res_dir = NULL;
- if (!dir || !dir->i_sb) {
- if (!dir) {
- printk("qnx4: NULL dir.\n");
- } else {
- printk("qnx4: no superblock on dir.\n");
- }
+ if (!dir->i_sb) {
+ printk("qnx4: no superblock on dir.\n");
return NULL;
}
bh = NULL;
@@ -108,7 +104,7 @@ static struct buffer_head *qnx4_find_entry(int len, struct inode *dir,
return NULL;
}
-int qnx4_lookup(struct inode *dir, struct dentry *dentry)
+struct dentry * qnx4_lookup(struct inode *dir, struct dentry *dentry)
{
int ino;
struct qnx4_inode_entry *de;
@@ -116,17 +112,10 @@ int qnx4_lookup(struct inode *dir, struct dentry *dentry)
struct buffer_head *bh;
const char *name = dentry->d_name.name;
int len = dentry->d_name.len;
- struct inode *foundinode;
+ struct inode *foundinode = NULL;
- if (!dir) {
- return -EBADF;
- }
- if (!S_ISDIR(dir->i_mode)) {
- return -EBADF;
- }
- if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino))) {
- return -ENOENT;
- }
+ if (!(bh = qnx4_find_entry(len, dir, name, &de, &ino)))
+ goto out;
/* The entry is linked, let's get the real info */
if ((de->di_status & QNX4_FILE_LINK) == QNX4_FILE_LINK) {
lnk = (struct qnx4_link_info *) de;
@@ -137,11 +126,12 @@ int qnx4_lookup(struct inode *dir, struct dentry *dentry)
if ((foundinode = iget(dir->i_sb, ino)) == NULL) {
QNX4DEBUG(("qnx4: lookup->iget -> NULL\n"));
- return -EACCES;
+ return ERR_PTR(-EACCES);
}
+out:
d_add(dentry, foundinode);
- return 0;
+ return NULL;
}
#ifdef CONFIG_QNX4FS_RW