PERFORCE change 100172 for review
John Baldwin
jhb at FreeBSD.org
Tue Jun 27 20:58:01 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=100172
Change 100172 by jhb at jhb_mutex on 2006/06/27 20:56:57
Do cheap error checking sooner.
Affected files ...
.. //depot/projects/smpng/sys/compat/linux/linux_file.c#30 edit
Differences ...
==== //depot/projects/smpng/sys/compat/linux/linux_file.c#30 (text+ko) ====
@@ -261,6 +261,16 @@
u_long *cookies = NULL, *cookiep;
int ncookies, vfslocked;
+ nbytes = args->count;
+ if (nbytes == 1) {
+ /* readdir(2) case. Always struct dirent. */
+ if (is64bit)
+ return (EINVAL);
+ nbytes = sizeof(linux_dirent);
+ justone = 1;
+ } else
+ justone = 0;
+
if ((error = getvnode(td->td_proc->p_fd, args->fd, &fp)) != 0)
return (error);
@@ -277,19 +287,6 @@
return (EINVAL);
}
- nbytes = args->count;
- if (nbytes == 1) {
- /* readdir(2) case. Always struct dirent. */
- if (is64bit) {
- VFS_UNLOCK_GIANT(vfslocked);
- fdrop(fp, td);
- return (EINVAL);
- }
- nbytes = sizeof(linux_dirent);
- justone = 1;
- } else
- justone = 0;
-
off = fp->f_offset;
buflen = max(LINUX_DIRBLKSIZ, nbytes);
More information about the p4-projects
mailing list