summaryrefslogtreecommitdiff
path: root/ext4_write.c
diff options
context:
space:
mode:
authorIru Cai <mytbk920423@gmail.com>2019-10-30 15:09:20 +0800
committerIru Cai <mytbk920423@gmail.com>2019-10-30 15:09:20 +0800
commiteef8e7b05ffab4c7d12a5f7e135357c0462c180c (patch)
treec9f0168afa6bc3588d55fddcbf50a59c8074ce8c /ext4_write.c
parentae51f41d14f548d494ac41e0d21137c5a4c3f59c (diff)
downloaduext4-eef8e7b05ffab4c7d12a5f7e135357c0462c180c.tar.xz
printf -> dbg_printf
Diffstat (limited to 'ext4_write.c')
-rw-r--r--ext4_write.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/ext4_write.c b/ext4_write.c
index 3368bd8..5098435 100644
--- a/ext4_write.c
+++ b/ext4_write.c
@@ -120,7 +120,7 @@ int ext4fs_get_bgdtable(void)
goto fail;
if (ext4fs_log_gdt(fs->gdtable)) {
- printf("Error in ext4fs_log_gdt\n");
+ dbg_printf("Error in ext4fs_log_gdt\n");
return -1;
}
@@ -144,7 +144,7 @@ static void delete_single_indirect_block(struct ext2_inode *inode)
struct ext_filesystem *fs = get_fs();
char *journal_buffer = zalloc(fs->blksz);
if (!journal_buffer) {
- printf("No memory\n");
+ dbg_printf("No memory\n");
return;
}
@@ -195,14 +195,14 @@ static void delete_double_indirect_block(struct ext2_inode *inode)
struct ext_filesystem *fs = get_fs();
char *journal_buffer = zalloc(fs->blksz);
if (!journal_buffer) {
- printf("No memory\n");
+ dbg_printf("No memory\n");
return;
}
if (inode->b.blocks.double_indir_block != 0) {
di_buffer = zalloc(fs->blksz);
if (!di_buffer) {
- printf("No memory\n");
+ dbg_printf("No memory\n");
return;
}
dib_start_addr = di_buffer;
@@ -294,14 +294,14 @@ static void delete_triple_indirect_block(struct ext2_inode *inode)
struct ext_filesystem *fs = get_fs();
char *journal_buffer = zalloc(fs->blksz);
if (!journal_buffer) {
- printf("No memory\n");
+ dbg_printf("No memory\n");
return;
}
if (inode->b.blocks.triple_indir_block != 0) {
tigp_buffer = zalloc(fs->blksz);
if (!tigp_buffer) {
- printf("No memory\n");
+ dbg_printf("No memory\n");
return;
}
tib_start_addr = tigp_buffer;
@@ -576,7 +576,7 @@ static int ext4fs_delete_file(int inodeno)
ext4fs_reinit_global();
if (ext4fs_init() != 0) {
- printf("error in File System init\n");
+ dbg_printf("error in File System init\n");
goto fail;
}
@@ -622,7 +622,7 @@ int ext4fs_init(void)
/* get the block group descriptor table */
fs->gdtable_blkno = ((EXT2_MIN_BLOCK_SIZE == fs->blksz) + 1);
if (ext4fs_get_bgdtable() == -1) {
- printf("Error in getting the block group descriptor table\n");
+ dbg_printf("Error in getting the block group descriptor table\n");
goto fail;
}
@@ -873,12 +873,12 @@ int ext4fs_write(const char *fname, const char *buffer,
goto fail;
if (ext4fs_init() != 0) {
- printf("error in File System init\n");
+ dbg_printf("error in File System init\n");
return -1;
}
if (le32_to_cpu(fs->sb->feature_ro_compat) & EXT4_FEATURE_RO_COMPAT_METADATA_CSUM) {
- printf("Unsupported feature metadata_csum found, not writing.\n");
+ dbg_printf("Unsupported feature metadata_csum found, not writing.\n");
return -1;
}
@@ -890,7 +890,7 @@ int ext4fs_write(const char *fname, const char *buffer,
goto fail;
/* do not mess up a directory using hash trees */
if (le32_to_cpu(g_parent_inode->flags) & EXT4_INDEX_FL) {
- printf("hash tree directory\n");
+ dbg_printf("hash tree directory\n");
goto fail;
}
/* check if the filename is already present in root */
@@ -923,7 +923,7 @@ int ext4fs_write(const char *fname, const char *buffer,
blocks_remaining = blks_reqd_for_file;
/* test for available space in partition */
if (le32_to_cpu(fs->sb->free_blocks) < blks_reqd_for_file) {
- printf("Not enough space on partition !!!\n");
+ dbg_printf("Not enough space on partition !!!\n");
goto fail;
}
@@ -979,7 +979,7 @@ int ext4fs_write(const char *fname, const char *buffer,
goto fail;
/* copy the file content into data blocks */
if (ext4fs_write_file(file_inode, 0, sizebytes, buffer) == -1) {
- printf("Error in copying content\n");
+ dbg_printf("Error in copying content\n");
/* FIXME: Deallocate data blocks */
goto fail;
}
@@ -1039,13 +1039,13 @@ int ext4_write_file(const char *filename, void *buf, loff_t offset,
int ret;
if (offset != 0) {
- printf("** Cannot support non-zero offset **\n");
+ dbg_printf("** Cannot support non-zero offset **\n");
return -1;
}
ret = ext4fs_write(filename, buf, len, FILETYPE_REG);
if (ret) {
- printf("** Error ext4fs_write() **\n");
+ dbg_printf("** Error ext4fs_write() **\n");
goto fail;
}