From aac17941320f7f73e5d411b152bfd041572e8a66 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 3 May 2005 11:46:16 -0700 Subject: Improve sha1 object file writing. Make it much safer: we write to a temporary file, and then link that temporary file to the final destination. This avoids all the nasty races if several people write the same object at the same time. It should also result in nicer on-disk layout, since it means that objects all get created in the same subdirectory. That makes a lot of block allocation algorithms happier, since the objects will now be allocated from the same zone. --- cache.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'cache.h') diff --git a/cache.h b/cache.h index 94f22c21d..8dd812827 100644 --- a/cache.h +++ b/cache.h @@ -128,9 +128,6 @@ extern int index_fd(unsigned char *sha1, int fd, struct stat *st); /* Return a statically allocated filename matching the sha1 signature */ extern char *sha1_file_name(const unsigned char *sha1); -/* Write a memory buffer out to the sha file */ -extern int write_sha1_buffer(const unsigned char *sha1, void *buf, unsigned int size); - /* Read and unpack a sha1 file into memory, write memory to a sha1 file */ extern void * map_sha1_file(const unsigned char *sha1, unsigned long *size); extern void * unpack_sha1_file(void *map, unsigned long mapsize, char *type, unsigned long *size); -- cgit v1.2.1