Rerolling sb/submodule-parallel-fetch for the time after 2.7
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest posting 2/20 of 7 patches 0 repliesNew
- v2 posting 1/27 patches 10 repliesSuperseded
- v18 patches 21 repliesSuperseded
Patches in v2 posting 2/2 No applies recorded yet
None of the 7 patches the cover letter announces are in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCHv2 0/7] Rerolling sb/submodule-parallel-fetch for the time after 2.7
with the interdiff below:
git-compat-util.h +0 -1
@@ -723,7 +723,6 @@ extern void *xmmap(void *start, size_t length, int prot, int flags, int fd, off_extern void *xmmap_gently (void *start,size_t length,int prot,int flags,int fd,off_t offset);extern int xopen (const char *path,int flags, ...);extern ssize_t xread (int fd,void *buf,size_t len); -extern ssize_t xread_nonblock (int fd,void *buf,size_t len);extern ssize_t xwrite (int fd,const void *buf,size_t len);extern ssize_t xpread (int fd,void *buf,size_t len,off_t offset);extern int xdup (int fd);
strbuf.c +1 -1
@@ -389,7 +389,7 @@ ssize_t strbuf_read_once(struct strbuf *sb, int fd, size_t hint)ssize_t cnt;strbuf_grow (sb, hint ? hint :8192 ); - cnt =xread_nonblock (fd, sb->buf + sb->len, sb->alloc - sb->len -1 ); + cnt =xread (fd, sb->buf + sb->len, sb->alloc - sb->len -1 );if (cnt >0 )strbuf_setlen (sb, sb->len + cnt);return cnt;
strbuf.h +4 -4
@@ -367,10 +367,10 @@ extern size_t strbuf_fread(struct strbuf *, size_t, FILE *);extern ssize_t strbuf_read (struct strbuf *,int fd,size_t hint);/** -* Returns the number of new bytes appended to the sb. -* Negative return value signals there was an error returned from -* underlying read(2), in which case the caller should check errno. -* e.g. errno == EAGAIN when the read may have blocked. +* Read the contents of a given file descriptor partially by using only one +* attempt of xread. The third argument can be used to give a hint about the +* file size, to avoid reallocs. Returns the number of new bytes appended to +* the sb. */ extern ssize_t strbuf_read_once (struct strbuf *,int fd,size_t hint);
wrapper.c +8 -23
@@ -243,7 +243,14 @@ ssize_t xread(int fd, void *buf, size_t len)struct pollfd pfd; pfd.events =POLLIN ; pfd.fd = fd; -/* We deliberately ignore the return value */ +/* +* it is OK if this poll() failed; we +* want to leave this infinite loop +* only when read() returns with +* success, or an expected failure, +* which would be checked by the next +* call to read(2). +*/ poll (&pfd,1 ,-1 ); } }
@@ -252,28 +259,6 @@ ssize_t xread(int fd, void *buf, size_t len) }/* -* xread_nonblock() is the same a read(), but it automatically restarts read() -* interrupted operations (EINTR). xread_nonblock() DOES NOT GUARANTEE that -* "len" bytes is read. EWOULDBLOCK is turned into EAGAIN. -*/ -ssize_t xread_nonblock (int fd,void *buf,size_t len) -{ -ssize_t nr; -if (len >MAX_IO_SIZE ) - len =MAX_IO_SIZE ; -while (1 ) { - nr =read (fd, buf, len); -if (nr <0 ) { -if (errno ==EINTR ) -continue ; -if (errno ==EWOULDBLOCK ) - errno =EAGAIN ; - } -return nr; - } -} - -/* * xwrite() is the same a write(), but it automatically restarts write() * operations with a recoverable error (EAGAIN and EINTR). xwrite() DOES NOT * GUARANTEE that "len" bytes is written even if the operation is successful.