summaryrefslogtreecommitdiff
path: root/ext4_utils/ext4_utils.h
diff options
context:
space:
mode:
authorDavid 'Digit' Turner <digit@google.com>2014-06-12 20:54:50 +0200
committerDavid 'Digit' Turner <digit@google.com>2014-06-13 10:16:30 +0200
commiteb5fcc3e932a8ccac1b580788a213c7782aff31b (patch)
treea1ae84a82d9522772b1bf14dea0e293b689d2dcd /ext4_utils/ext4_utils.h
parentb733b3c7b0601326801d43f548aa139ca0be721e (diff)
downloadextras-eb5fcc3e932a8ccac1b580788a213c7782aff31b.tar.gz
Ignore wipe operation on non-block devices.
The implementation of make_ext4fs() calls make_ext4fs_internal() by forcing the |wipe| parameter to true, which is problematic when the library is used within the emulator (the wipe operation will always fail on non-Linux platforms). This patch does the following: - Add a 'is_block_device_fd()' function to check that a file descriptor points to a real block device. - Modify the implementation of wipe_block_device() uses it to return silently when trying to wipe a non-block-device file. - Add a WIPE_IS_SUPPORTED flag in wipe.h that indicates whether block device wiping is supported on the current platform (for now, this is only the case on Linux). BUG=NONE Change-Id: I62b62b7c3e99b465c3b876154231e7c2fe541b23
Diffstat (limited to 'ext4_utils/ext4_utils.h')
-rw-r--r--ext4_utils/ext4_utils.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/ext4_utils/ext4_utils.h b/ext4_utils/ext4_utils.h
index 447d4161..c6f52b5b 100644
--- a/ext4_utils/ext4_utils.h
+++ b/ext4_utils/ext4_utils.h
@@ -140,6 +140,7 @@ void ext4_create_journal_inode(void);
void ext4_update_free(void);
void ext4_queue_sb(void);
u64 get_block_device_size(int fd);
+int is_block_device_fd(int fd);
u64 get_file_size(int fd);
u64 parse_num(const char *arg);
void ext4_parse_sb_info(struct ext4_super_block *sb);