summaryrefslogtreecommitdiff
path: root/ext4_utils/ext4_utils.h
diff options
context:
space:
mode:
authorAnatol Pomazau <anatol@google.com>2012-01-11 15:12:27 -0800
committerAnatol Pomazau <anatol@google.com>2012-02-03 14:40:49 -0800
commit89ddaab97e9214cf331baffee2de4595ad14dc79 (patch)
tree08f4de0ccce24a3b3672db9ec3f60e461c52f74c /ext4_utils/ext4_utils.h
parentae4f7dccadfafc36470a3e6f3084c6cf3cc63415 (diff)
downloadextras-89ddaab97e9214cf331baffee2de4595ad14dc79.tar.gz
Pass file descriptor instead of file name
Passing a file descriptor to make_ext4fs_internal() is more flexible. We can use tmpfile() to create a temporary file. tmpfile() is better than other solutions because it unlinks the file right after creating it, so closing fd effectively removes temp file. Thus we don't have to worry about large temp files accidently left on the filesystem in case of the program crash. Change-Id: I44146704572c314e1d6cfca7ce918efa7fb92a7a
Diffstat (limited to 'ext4_utils/ext4_utils.h')
-rw-r--r--ext4_utils/ext4_utils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h
index bb9c09e8..033e6b7e 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/ext4_utils.h
@@ -151,7 +151,7 @@ static inline int log_2(int j)
}
int ext4_bg_has_super_block(int bg);
-void write_ext4_image(const char *filename, int gz, int sparse, int crc,
+void write_ext4_image(int fd, int gz, int sparse, int crc,
int wipe);
void ext4_create_fs_aux_info(void);
void ext4_free_fs_aux_info(void);
@@ -160,7 +160,7 @@ void ext4_create_resize_inode(void);
void ext4_create_journal_inode(void);
void ext4_update_free(void);
void ext4_queue_sb(void);
-u64 get_file_size(const char *filename);
+u64 get_file_size(int fd);
u64 parse_num(const char *arg);
void ext4_parse_sb(struct ext4_super_block *sb);