summaryrefslogtreecommitdiffstats
path: root/src/rfs_dir.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-11-16 12:53:21 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2008-11-16 12:53:21 +0100
commit07b1742903d2b483ca4afc1d39d1b644eb755e5a (patch)
treea72a91c3d25247474c5c91e5ce30a85c3e23d64d /src/rfs_dir.c
parent8453cfff02206ad932e8ddd3c24b34aa7c42af62 (diff)
Code cleanup after using LLVM/Clang Static Analyzer
Diffstat (limited to 'src/rfs_dir.c')
-rw-r--r--src/rfs_dir.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/rfs_dir.c b/src/rfs_dir.c
index 6951b82..6303dda 100644
--- a/src/rfs_dir.c
+++ b/src/rfs_dir.c
@@ -138,20 +138,22 @@ static int file_read(dal_t *dal, void *buff, blk_t block, blk_t count) {
static int file_write(dal_t *dal, void *buff, blk_t block, blk_t count)
{
- uint64_t off, blocklen;
if (!dal || !buff)
return 0;
+#ifdef ENABLE_REISERFS_WRITE
+ {
+ uint64_t off, blocklen;
#ifdef HAVE_DAL_T_BLOCK_SIZE
- off = (uint64_t)block * (uint64_t)dal->block_size;
- blocklen = (uint64_t)count * (uint64_t)dal->block_size;
+ off = (uint64_t)block * (uint64_t)dal->block_size;
+ blocklen = (uint64_t)count * (uint64_t)dal->block_size;
#else
- off = (uint64_t)block * (uint64_t)dal->blocksize;
- blocklen = (uint64_t)count * (uint64_t)dal->blocksize;
+ off = (uint64_t)block * (uint64_t)dal->blocksize;
+ blocklen = (uint64_t)count * (uint64_t)dal->blocksize;
#endif
-#ifdef ENABLE_REISERFS_WRITE
- if(my_data->disk_car->write(my_data->disk_car,blocklen,buff,my_data->partition->part_offset+off))
- return 0;
- return 1;
+ if(my_data->disk_car->write(my_data->disk_car,blocklen,buff,my_data->partition->part_offset+off))
+ return 0;
+ return 1;
+ }
#else
log_info("reiser file_write not implemented\n");
return 0;