From 7b4b5a088a085d1279a886ca58718910bf3beb8e Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Tue, 5 Feb 2002 18:53:15 -0800 Subject: [PATCH] [PATCH] missing ->i_zombie in hpux_getdents() hpux_getdents() contains a years-old copy of code from fs/readdir.c. Switched to use of vfs_readdir(), which does correct locking. --- arch/parisc/hpux/fs.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/arch/parisc/hpux/fs.c b/arch/parisc/hpux/fs.c index 9942c0545265..99c06ba7edc1 100644 --- a/arch/parisc/hpux/fs.c +++ b/arch/parisc/hpux/fs.c @@ -83,42 +83,20 @@ static int filldir(void * __buf, const char * name, int namlen, loff_t offset, i int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int count) { struct file * file; - struct dentry * dentry; - struct inode * inode; struct hpux_dirent * lastdirent; struct getdents_callback buf; - int error; + int error = -EBADF; - lock_kernel(); - error = -EBADF; file = fget(fd); if (!file) goto out; - dentry = file->f_dentry; - if (!dentry) - goto out_putf; - - inode = dentry->d_inode; - if (!inode) - goto out_putf; - buf.current_dir = dirent; buf.previous = NULL; buf.count = count; buf.error = 0; - error = -ENOTDIR; - if (!file->f_op || !file->f_op->readdir) - goto out_putf; - - /* - * Get the inode's semaphore to prevent changes - * to the directory while we read it. - */ - down(&inode->i_sem); - error = file->f_op->readdir(file, &buf, filldir); - up(&inode->i_sem); + error = vfs_readdir(file, &buf, filldir); if (error < 0) goto out_putf; error = buf.error; @@ -131,7 +109,6 @@ int hpux_getdents(unsigned int fd, struct hpux_dirent *dirent, unsigned int coun out_putf: fput(file); out: - unlock_kernel(); return error; } -- 2.39.5