summaryrefslogtreecommitdiff
path: root/src/filelock.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-21 17:05:16 +0200
committerVicent Marti <tanoku@gmail.com>2011-02-21 18:13:43 +0200
commit817c28201e2a9564b38a624be491245aa025c77f (patch)
treedfcf8639c04f6e1ddfe3eb6b9980dc0b3d06cd21 /src/filelock.h
parent874c3b6f37e291233be389dbacdb7178af85ad2f (diff)
downloadlibgit2-817c28201e2a9564b38a624be491245aa025c77f.tar.gz
Rewrite all file IO for more performance
The new `git_filebuf` structure provides atomic high-performance writes to disk by using a write cache, and optionally a double-buffered scheme through a worker thread (not enabled yet). Writes can be done 3-layered, like in git.git (user code -> write cache -> disk), or 2-layered, by writing directly on the cache. This makes index writing considerably faster. The `git_filebuf` structure contains all the old functionality of `git_filelock` for atomic file writes and reads. The `git_filelock` structure has been removed. Additionally, the `git_filebuf` API allows to automatically hash (SHA1) all the data as it is written to disk (hashing is done smartly on big chunks to improve performance). Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/filelock.h')
-rw-r--r--src/filelock.h23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/filelock.h b/src/filelock.h
deleted file mode 100644
index bff861811..000000000
--- a/src/filelock.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef INCLUDE_filelock_h__
-#define INCLUDE_filelock_h__
-
-#include "fileops.h"
-
-struct git_filelock {
-
- char path[GIT_PATH_MAX];
- size_t path_length;
-
- git_file file_lock;
- int is_locked;
-};
-
-typedef struct git_filelock git_filelock;
-
-int git_filelock_init(git_filelock *lock, const char *path);
-int git_filelock_lock(git_filelock *lock, int append);
-void git_filelock_unlock(git_filelock *lock);
-int git_filelock_commit(git_filelock *lock);
-int git_filelock_write(git_filelock *lock, const void *buffer, size_t length);
-
-#endif