patch-2.2.7 linux/fs/sysv/namei.c
Next file: linux/fs/ufs/dir.c
Previous file: linux/fs/sysv/dir.c
Back to the patch index
Back to the overall index
- Lines: 59
- Date:
Fri Apr 23 21:20:38 1999
- Orig file:
v2.2.6/linux/fs/sysv/namei.c
- Orig date:
Fri Apr 16 14:47:31 1999
diff -u --recursive --new-file v2.2.6/linux/fs/sysv/namei.c linux/fs/sysv/namei.c
@@ -103,17 +103,12 @@
return NULL;
}
-int sysv_lookup(struct inode * dir, struct dentry * dentry)
+struct dentry *sysv_lookup(struct inode * dir, struct dentry * dentry)
{
struct inode * inode = NULL;
struct sysv_dir_entry * de;
struct buffer_head * bh;
- if (!dir)
- return -ENOENT;
- if (!S_ISDIR(dir->i_mode)) {
- return -ENOENT;
- }
bh = sysv_find_entry(dir, dentry->d_name.name, dentry->d_name.len, &de);
if (bh) {
@@ -122,10 +117,10 @@
inode = iget(dir->i_sb, ino);
if (!inode)
- return -EACCES;
+ return ERR_PTR(-EACCES);
}
d_add(dentry, inode);
- return 0;
+ return NULL;
}
/*
@@ -209,8 +204,6 @@
struct buffer_head * bh;
struct sysv_dir_entry * de;
- if (!dir)
- return -ENOENT;
inode = sysv_new_inode(dir);
if (!inode)
return -ENOSPC;
@@ -239,8 +232,6 @@
struct buffer_head * bh;
struct sysv_dir_entry * de;
- if (!dir)
- return -ENOENT;
bh = sysv_find_entry(dir, dentry->d_name.name,
dentry->d_name.len, &de);
if (bh) {
@@ -286,8 +277,6 @@
struct buffer_head * bh, *dir_block;
struct sysv_dir_entry * de;
- if (!dir)
- return -EINVAL;
bh = sysv_find_entry(dir, dentry->d_name.name,
dentry->d_name.len, &de);
if (bh) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)