Date: Thu, 11 Feb 2016 15:27:15 +0000 (UTC) From: "Pedro F. Giffuni" <pfg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r295523 - head/sys/fs/ext2fs Message-ID: <201602111527.u1BFRFMe011283@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: pfg Date: Thu Feb 11 15:27:14 2016 New Revision: 295523 URL: https://svnweb.freebsd.org/changeset/base/295523 Log: 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. Modified: head/sys/fs/ext2fs/ext2_extents.c head/sys/fs/ext2fs/ext2_extents.h Modified: head/sys/fs/ext2fs/ext2_extents.c ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.c Thu Feb 11 14:45:18 2016 (r295522) +++ head/sys/fs/ext2fs/ext2_extents.c Thu Feb 11 15:27:14 2016 (r295523) @@ -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 *i 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, str 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, str 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 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); Modified: head/sys/fs/ext2fs/ext2_extents.h ============================================================================== --- head/sys/fs/ext2fs/ext2_extents.h Thu Feb 11 14:45:18 2016 (r295522) +++ head/sys/fs/ext2fs/ext2_extents.h Thu Feb 11 15:27:14 2016 (r295523) @@ -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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201602111527.u1BFRFMe011283>