From: Andre Noll Date: Fri, 6 Jun 2008 09:36:17 +0000 (+0200) Subject: Rename para_truncate() to truncate_file(). X-Git-Tag: v0.1.0~61 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=68aa66b6f051083b8f9fe9cf65b0a20fed4363f9;p=osl.git Rename para_truncate() to truncate_file(). --- diff --git a/fd.c b/fd.c index 920bce9..1519ac5 100644 --- a/fd.c +++ b/fd.c @@ -334,7 +334,7 @@ __must_check __printf_1_2 __malloc char *make_message(const char *fmt, ...) * * \sa truncate(2) */ -int para_truncate(const char *path, off_t size) +int truncate_file(const char *path, off_t size) { int ret; struct stat statbuf; diff --git a/fd.h b/fd.h index 9c43eec..c660bab 100644 --- a/fd.h +++ b/fd.h @@ -14,7 +14,7 @@ int mmap_full_file(const char *filename, int open_mode, void **map, int osl_munmap(void *start, size_t length); int write_all(int fd, const char *buf, size_t *len); int write_file(const char *filename, const void *buf, size_t size); -int para_truncate(const char *filename, off_t size); +int truncate_file(const char *filename, off_t size); /** * A wrapper for mkdir(2). diff --git a/fsck.c b/fsck.c index 55c134a..574509f 100644 --- a/fsck.c +++ b/fsck.c @@ -412,7 +412,7 @@ static int prune_invalid_rows_from_index(struct osl_table *t) DEBUG_LOG("unmapping index\n"); osl_munmap(t->index_map.data, t->index_map.size); filename = index_filename(t->desc); - ret = para_truncate(filename, t->row_index_size + ret = truncate_file(filename, t->row_index_size * t->num_invalid_rows); free(filename); if (ret < 0) diff --git a/osl.c b/osl.c index 3e41c53..af448b4 100644 --- a/osl.c +++ b/osl.c @@ -1186,7 +1186,7 @@ static int truncate_mapped_file(const struct osl_table *t, unsigned col_num, if (!filename) return -ERRNO_TO_ERROR(ENOMEM); - ret = para_truncate(filename, size); + ret = truncate_file(filename, size); free(filename); return ret; } @@ -1312,7 +1312,7 @@ __export int osl_add_and_get_row(struct osl_table *t, struct osl_object *objects if (ret < 0) { /* truncate index and rollback changes */ char *filename = index_filename(t->desc); if (filename) - para_truncate(filename, t->row_index_size); + truncate_file(filename, t->row_index_size); free(filename); goto rollback; }