login
Header Space

 
 

Re: [PATCH] Replacing the system call pread() with lseek()/xread()/lseek() sequence.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andy Whitcroft <apw@...>
Cc: Stefan-W. Hahn <stefan.hahn@...>, <git@...>
Date: Tuesday, January 9, 2007 - 7:25 pm

Andy Whitcroft <apw@shadowen.org> wrote:

With the exception of this style difference, the patch looked
pretty good.  Nice work Stefan.  Andy's right, we do tend to prefer
"rc = read_in_full" over "rc=read_in_full".  Quite a bit actually,
though Junio is the final decider on all such matters as he gets
to choose to accept or reject the patch.  ;-)


Andy's right actually.  If we are using pread() we aren't relying
on the current file pointer.  Which means its unnecessary to get
the current pointer before seeking to the requested offset, and its
unnecessary to restore it before the git_pread() function returns.

Though its a possibly unnecessary optimization as like Andy points
out, most sane systems already have a working pread() implementation.
And those that don't, well, probably should be made to be sane.
But we don't need to make Git suffer there if we don't have to.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] Replacing the system call pread() with lseek()/x..., Johannes Schindelin, (Tue Jan 9, 7:42 pm)
Re: [PATCH] Replacing the system call pread() with lseek()/x..., Shawn O. Pearce, (Tue Jan 9, 7:25 pm)
Re: [PATCH] Replacing the system call pread() with lseek()/x..., Johannes Schindelin, (Tue Jan 9, 8:30 pm)
speck-geostationary