patch-2.3.50 linux/arch/alpha/kernel/osf_sys.c
Next file: linux/arch/arm/Makefile
Previous file: linux/arch/alpha/kernel/Makefile
Back to the patch index
Back to the overall index
- Lines: 43
- Date:
Mon Mar 6 15:49:21 2000
- Orig file:
v2.3.49/linux/arch/alpha/kernel/osf_sys.c
- Orig date:
Fri Jan 28 15:09:06 2000
diff -u --recursive --new-file v2.3.49/linux/arch/alpha/kernel/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
@@ -135,10 +135,8 @@
{
int error;
struct file *file;
- struct inode *inode;
struct osf_dirent_callback buf;
- lock_kernel();
error = -EBADF;
file = fget(fd);
if (!file)
@@ -149,18 +147,8 @@
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.
- */
- inode = file->f_dentry->d_inode;
- down(&inode->i_sem);
- error = file->f_op->readdir(file, &buf, osf_filldir);
- up(&inode->i_sem);
+ lock_kernel();
+ error = vfs_readdir(file, osf_filldir, &buf);
if (error < 0)
goto out_putf;
@@ -169,9 +157,9 @@
error = count - buf.count;
out_putf:
+ unlock_kernel();
fput(file);
out:
- unlock_kernel();
return error;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)