Reduces memory occupation with many files.

This commit is contained in:
Andrea Mazzoleni 2013-02-26 21:26:45 +01:00
parent a41443b6b6
commit b7bedc8b60
5 changed files with 43 additions and 3 deletions

7
elem.h
View file

@ -159,7 +159,7 @@ struct snapraid_file {
int mtime_nsec; /**< Modification time nanoseconds. In the range 0 <= x < 1,000,000,000, or FILE_MTIME_NSEC_INVALID. */
block_off_t blockmax; /**< Number of blocks. */
unsigned flag; /**< FILE_IS_* flags. */
char sub[PATH_MAX]; /**< Sub path of the file. Without the disk dir. The disk is implicit. */
char* sub; /**< Sub path of the file. Without the disk dir. The disk is implicit. */
/* nodes for data structures */
tommy_node nodelist;
@ -464,6 +464,11 @@ struct snapraid_file* file_alloc(unsigned block_size, const char* sub, uint64_t
*/
void file_free(struct snapraid_file* file);
/**
* Rename a file.
*/
void file_rename(struct snapraid_file* file, const char* sub);
/**
* Returns the name of the file, without the dir.
*/