summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2016-02-11 15:27:14 +0000
committerpfg <pfg@FreeBSD.org>2016-02-11 15:27:14 +0000
commit4d87c063868bbec8eef87b8a61e80037f9f28c7e (patch)
tree44e4c5745bdfd462dc9a5d5021b33df0db55ce34 /sys/fs
parent239377f05e66aeffa239958bf102cf53a043c8b9 (diff)
downloadFreeBSD-src-4d87c063868bbec8eef87b8a61e80037f9f28c7e.zip
FreeBSD-src-4d87c063868bbec8eef87b8a61e80037f9f28c7e.tar.gz
Ext4: Use boolean type instead of '0' and '1'
There are precedents of uses of bool in the kernel and it is incorrect style to use integers as replacement for a boolean type.
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/ext2fs/ext2_extents.c14
-rw-r--r--sys/fs/ext2fs/ext2_extents.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/sys/fs/ext2fs/ext2_extents.c b/sys/fs/ext2fs/ext2_extents.c
index 230356c..a66f682 100644
--- a/sys/fs/ext2fs/ext2_extents.c
+++ b/sys/fs/ext2fs/ext2_extents.c
@@ -43,7 +43,7 @@
#include <fs/ext2fs/ext2_extents.h>
#include <fs/ext2fs/ext2_extern.h>
-static int
+static bool
ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path *path,
daddr_t lbn, daddr_t *first_lbn, daddr_t *last_lbn)
{
@@ -67,14 +67,14 @@ ext4_ext_binsearch_index(struct inode *ip, struct ext4_extent_path *path,
path->ep_sparse_ext.e_len = first->ei_blk - *first_lbn;
path->ep_sparse_ext.e_start_hi = 0;
path->ep_sparse_ext.e_start_lo = 0;
- path->ep_is_sparse = 1;
- return (1);
+ path->ep_is_sparse = true;
+ return (true);
}
path->ep_index = l - 1;
*first_lbn = path->ep_index->ei_blk;
if (path->ep_index < last)
*last_lbn = l->ei_blk - 1;
- return (0);
+ return (false);
}
static void
@@ -103,7 +103,7 @@ ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn,
path->ep_sparse_ext.e_len = first->e_blk - first_lbn;
path->ep_sparse_ext.e_start_hi = 0;
path->ep_sparse_ext.e_start_lo = 0;
- path->ep_is_sparse = 1;
+ path->ep_is_sparse = true;
return;
}
path->ep_ext = l - 1;
@@ -118,7 +118,7 @@ ext4_ext_binsearch(struct inode *ip, struct ext4_extent_path *path, daddr_t lbn,
path->ep_sparse_ext.e_blk + 1;
path->ep_sparse_ext.e_start_hi = 0;
path->ep_sparse_ext.e_start_lo = 0;
- path->ep_is_sparse = 1;
+ path->ep_is_sparse = true;
}
}
@@ -213,7 +213,7 @@ ext4_ext_find_extent(struct m_ext2fs *fs, struct inode *ip,
path->ep_depth = i;
path->ep_ext = NULL;
path->ep_index = NULL;
- path->ep_is_sparse = 0;
+ path->ep_is_sparse = false;
ext4_ext_binsearch(ip, path, lbn, first_lbn, last_lbn);
return (path);
diff --git a/sys/fs/ext2fs/ext2_extents.h b/sys/fs/ext2fs/ext2_extents.h
index 4ce16f3..70eb685 100644
--- a/sys/fs/ext2fs/ext2_extents.h
+++ b/sys/fs/ext2fs/ext2_extents.h
@@ -84,7 +84,7 @@ struct ext4_extent_cache {
struct ext4_extent_path {
uint16_t ep_depth;
struct buf *ep_bp;
- int ep_is_sparse;
+ bool ep_is_sparse;
union {
struct ext4_extent ep_sparse_ext;
struct ext4_extent *ep_ext;
OpenPOWER on IntegriCloud