diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1999-06-13 16:29:25 +0000 |
commit | db7d4daea91e105e3859cf461d7e53b9b77454b2 (patch) | |
tree | 9bb65b95440af09e8aca63abe56970dd3360cc57 /fs/devpts | |
parent | 9c1c01ead627bdda9211c9abd5b758d6c687d8ac (diff) |
Merge with Linux 2.2.8.
Diffstat (limited to 'fs/devpts')
-rw-r--r-- | fs/devpts/root.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/fs/devpts/root.c b/fs/devpts/root.c index f517367b9..c284f1d97 100644 --- a/fs/devpts/root.c +++ b/fs/devpts/root.c @@ -17,8 +17,8 @@ #include "devpts_i.h" static int devpts_root_readdir(struct file *,void *,filldir_t); -static int devpts_root_lookup(struct inode *,struct dentry *); -static int devpts_revalidate(struct dentry *); +static struct dentry *devpts_root_lookup(struct inode *,struct dentry *); +static int devpts_revalidate(struct dentry *, int); static struct file_operations devpts_root_operations = { NULL, /* llseek */ @@ -81,9 +81,6 @@ static int devpts_root_readdir(struct file *filp, void *dirent, filldir_t filldi off_t nr; char numbuf[16]; - if (!inode || !S_ISDIR(inode->i_mode)) - return -ENOTDIR; - nr = filp->f_pos; switch(nr) @@ -119,7 +116,7 @@ static int devpts_root_readdir(struct file *filp, void *dirent, filldir_t filldi * the pty really does still exist. Never revalidate negative dentries; * for simplicity (fix later?) */ -static int devpts_revalidate(struct dentry * dentry) +static int devpts_revalidate(struct dentry * dentry, int flags) { struct devpts_sb_info *sbi; @@ -131,42 +128,39 @@ static int devpts_revalidate(struct dentry * dentry) return ( sbi->inodes[dentry->d_inode->i_ino - 2] == dentry->d_inode ); } -static int devpts_root_lookup(struct inode * dir, struct dentry * dentry) +static struct dentry *devpts_root_lookup(struct inode * dir, struct dentry * dentry) { struct devpts_sb_info *sbi = SBI(dir->i_sb); unsigned int entry; int i; const char *p; - if (!S_ISDIR(dir->i_mode)) - return -ENOTDIR; - dentry->d_inode = NULL; /* Assume failure */ dentry->d_op = &devpts_dentry_operations; if ( dentry->d_name.len == 1 && dentry->d_name.name[0] == '0' ) { entry = 0; } else if ( dentry->d_name.len < 1 ) { - return 0; + return NULL; } else { p = dentry->d_name.name; if ( *p < '1' || *p > '9' ) - return 0; + return NULL; entry = *p++ - '0'; for ( i = dentry->d_name.len-1 ; i ; i-- ) { unsigned int nentry = *p++ - '0'; if ( nentry > 9 ) - return 0; + return NULL; nentry += entry * 10; if (nentry < entry) - return 0; + return NULL; entry = nentry; } } if ( entry >= sbi->max_ptys ) - return 0; + return NULL; dentry->d_inode = sbi->inodes[entry]; if ( dentry->d_inode ) @@ -174,5 +168,5 @@ static int devpts_root_lookup(struct inode * dir, struct dentry * dentry) d_add(dentry, dentry->d_inode); - return 0; + return NULL; } |