mirror of
https://git.proxmox.com/git/libgit2
synced 2025-06-20 17:56:40 +00:00
Actually do the mmap... unsurprisingly, this makes the indexer work on SFS
On RAM: the .idx and .pack files become links to a .lock and the original download respectively. Assume some feature (such as record locking) supported by SFS but not JXFS or RAM: is required.
This commit is contained in:
parent
90490113af
commit
2aeadb9c78
@ -363,11 +363,11 @@ int git_indexer_stream_add(git_indexer_stream *idx, const void *data, size_t siz
|
||||
if (error < 0) {
|
||||
idx->off = entry_start;
|
||||
error = store_delta(idx);
|
||||
|
||||
if (error == GIT_EBUFS)
|
||||
return 0;
|
||||
if (error < 0)
|
||||
return error;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -158,6 +158,7 @@ static git_mwindow *new_window(
|
||||
git_mwindow *w;
|
||||
|
||||
w = git__malloc(sizeof(*w));
|
||||
|
||||
if (w == NULL)
|
||||
return NULL;
|
||||
|
||||
|
@ -215,7 +215,7 @@ static int packfile_unpack_header1(
|
||||
unsigned shift;
|
||||
unsigned long size, c;
|
||||
unsigned long used = 0;
|
||||
printf("[pack 218] buf = %lx, used = %ld, len = %ld\n", buf, used, len);
|
||||
|
||||
c = buf[used++];
|
||||
*type = (c >> 4) & 7;
|
||||
size = c & 15;
|
||||
@ -261,8 +261,8 @@ int git_packfile_unpack_header(
|
||||
base = git_mwindow_open(mwf, w_curs, *curpos, 20, &left);
|
||||
if (base == NULL)
|
||||
return GIT_EBUFS;
|
||||
printf("[pack 264] base = %lx, mwf = %lx\n", base, mwf);
|
||||
ret = packfile_unpack_header1(&used, size_p, type_p, base, left);
|
||||
|
||||
ret = packfile_unpack_header1(&used, size_p, type_p, base, left);
|
||||
git_mwindow_close(w_curs);
|
||||
if (ret == GIT_EBUFS)
|
||||
return ret;
|
||||
|
@ -39,11 +39,11 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
|
||||
#else
|
||||
if ((prot & GIT_PROT_WRITE) && ((flags & GIT_MAP_TYPE) == GIT_MAP_SHARED)) {
|
||||
printf("Trying to map shared-writeable file!!!\n");
|
||||
}
|
||||
|
||||
if(out->data = malloc(len)) {
|
||||
lseek(fd, offset, SEEK_SET);
|
||||
p_read(fd, out->data, len);
|
||||
}
|
||||
if(out->data = malloc(len)) {
|
||||
lseek(fd, offset, SEEK_SET);
|
||||
p_read(fd, out->data, len);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user