linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs:Make the function check_dnode have a return type of bool
@ 2015-06-29 20:07 Nicholas Krause
  2015-07-01  0:50 ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: Nicholas Krause @ 2015-06-29 20:07 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

This makes the function check_dnode have a return type of bool
due to this particular function only ever returning either one
or zero as its return value.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 fs/f2fs/gc.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index e1e7361..ebd4c6c 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -487,7 +487,7 @@ block_t start_bidx_of_node(unsigned int node_ofs, struct f2fs_inode_info *fi)
 	return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE(fi);
 }
 
-static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
+static bool check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 		struct node_info *dni, block_t blkaddr, unsigned int *nofs)
 {
 	struct page *node_page;
@@ -500,13 +500,13 @@ static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 
 	node_page = get_node_page(sbi, nid);
 	if (IS_ERR(node_page))
-		return 0;
+		return false;
 
 	get_node_info(sbi, nid, dni);
 
 	if (sum->version != dni->version) {
 		f2fs_put_page(node_page, 1);
-		return 0;
+		return false;
 	}
 
 	*nofs = ofs_of_node(node_page);
@@ -514,8 +514,8 @@ static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
 	f2fs_put_page(node_page, 1);
 
 	if (source_blkaddr != blkaddr)
-		return 0;
-	return 1;
+		return false;
+	return true;
 }
 
 static void move_encrypted_block(struct inode *inode, block_t bidx)
-- 
2.1.4


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] f2fs:Make the function check_dnode have a return type of bool
  2015-06-29 20:07 [PATCH] f2fs:Make the function check_dnode have a return type of bool Nicholas Krause
@ 2015-07-01  0:50 ` Jaegeuk Kim
  2015-07-01  0:56   ` nick
  0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2015-07-01  0:50 UTC (permalink / raw)
  To: Nicholas Krause; +Cc: cm224.lee, linux-f2fs-devel, linux-kernel

Hi,

On Mon, Jun 29, 2015 at 04:07:01PM -0400, Nicholas Krause wrote:
> This makes the function check_dnode have a return type of bool
> due to this particular function only ever returning either one
> or zero as its return value.
> 
> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> ---
>  fs/f2fs/gc.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index e1e7361..ebd4c6c 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -487,7 +487,7 @@ block_t start_bidx_of_node(unsigned int node_ofs, struct f2fs_inode_info *fi)
>  	return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE(fi);
>  }
>  
> -static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
> +static bool check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,

Then, what about bool is_data_alive() ?

Thanks,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] f2fs:Make the function check_dnode have a return type of bool
  2015-07-01  0:50 ` Jaegeuk Kim
@ 2015-07-01  0:56   ` nick
  2015-07-01  1:08     ` Jaegeuk Kim
  0 siblings, 1 reply; 5+ messages in thread
From: nick @ 2015-07-01  0:56 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel



On 2015-06-30 08:50 PM, Jaegeuk Kim wrote:
> Hi,
> 
> On Mon, Jun 29, 2015 at 04:07:01PM -0400, Nicholas Krause wrote:
>> This makes the function check_dnode have a return type of bool
>> due to this particular function only ever returning either one
>> or zero as its return value.
>>
>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>> ---
>>  fs/f2fs/gc.c | 10 +++++-----
>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index e1e7361..ebd4c6c 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -487,7 +487,7 @@ block_t start_bidx_of_node(unsigned int node_ofs, struct f2fs_inode_info *fi)
>>  	return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE(fi);
>>  }
>>  
>> -static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
>> +static bool check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
> 
> Then, what about bool is_data_alive() ?
> 
> Thanks,
> 
There is no function of this name in my searching with either lxr or cscope.
Either my tools aren't finding it or the function you are requesting I make
bool has been removed.
Nick

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] f2fs:Make the function check_dnode have a return type of bool
  2015-07-01  0:56   ` nick
@ 2015-07-01  1:08     ` Jaegeuk Kim
  2015-07-01  1:14       ` nick
  0 siblings, 1 reply; 5+ messages in thread
From: Jaegeuk Kim @ 2015-07-01  1:08 UTC (permalink / raw)
  To: nick; +Cc: cm224.lee, linux-f2fs-devel, linux-kernel

On Tue, Jun 30, 2015 at 08:56:17PM -0400, nick wrote:
> 
> 
> On 2015-06-30 08:50 PM, Jaegeuk Kim wrote:
> > Hi,
> > 
> > On Mon, Jun 29, 2015 at 04:07:01PM -0400, Nicholas Krause wrote:
> >> This makes the function check_dnode have a return type of bool
> >> due to this particular function only ever returning either one
> >> or zero as its return value.
> >>
> >> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
> >> ---
> >>  fs/f2fs/gc.c | 10 +++++-----
> >>  1 file changed, 5 insertions(+), 5 deletions(-)
> >>
> >> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> >> index e1e7361..ebd4c6c 100644
> >> --- a/fs/f2fs/gc.c
> >> +++ b/fs/f2fs/gc.c
> >> @@ -487,7 +487,7 @@ block_t start_bidx_of_node(unsigned int node_ofs, struct f2fs_inode_info *fi)
> >>  	return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE(fi);
> >>  }
> >>  
> >> -static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
> >> +static bool check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
> > 
> > Then, what about bool is_data_alive() ?
> > 
> > Thanks,
> > 
> There is no function of this name in my searching with either lxr or cscope.
> Either my tools aren't finding it or the function you are requesting I make
> bool has been removed.
> Nick

I meant;
if you want to change the return type as a bool type, what about changing its
function name too? (e.g., is_data_alive())

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] f2fs:Make the function check_dnode have a return type of bool
  2015-07-01  1:08     ` Jaegeuk Kim
@ 2015-07-01  1:14       ` nick
  0 siblings, 0 replies; 5+ messages in thread
From: nick @ 2015-07-01  1:14 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel



On 2015-06-30 09:08 PM, Jaegeuk Kim wrote:
> On Tue, Jun 30, 2015 at 08:56:17PM -0400, nick wrote:
>>
>>
>> On 2015-06-30 08:50 PM, Jaegeuk Kim wrote:
>>> Hi,
>>>
>>> On Mon, Jun 29, 2015 at 04:07:01PM -0400, Nicholas Krause wrote:
>>>> This makes the function check_dnode have a return type of bool
>>>> due to this particular function only ever returning either one
>>>> or zero as its return value.
>>>>
>>>> Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
>>>> ---
>>>>  fs/f2fs/gc.c | 10 +++++-----
>>>>  1 file changed, 5 insertions(+), 5 deletions(-)
>>>>
>>>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>>>> index e1e7361..ebd4c6c 100644
>>>> --- a/fs/f2fs/gc.c
>>>> +++ b/fs/f2fs/gc.c
>>>> @@ -487,7 +487,7 @@ block_t start_bidx_of_node(unsigned int node_ofs, struct f2fs_inode_info *fi)
>>>>  	return bidx * ADDRS_PER_BLOCK + ADDRS_PER_INODE(fi);
>>>>  }
>>>>  
>>>> -static int check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
>>>> +static bool check_dnode(struct f2fs_sb_info *sbi, struct f2fs_summary *sum,
>>>
>>> Then, what about bool is_data_alive() ?
>>>
>>> Thanks,
>>>
>> There is no function of this name in my searching with either lxr or cscope.
>> Either my tools aren't finding it or the function you are requesting I make
>> bool has been removed.
>> Nick
> 
> I meant;
> if you want to change the return type as a bool type, what about changing its
> function name too? (e.g., is_data_alive())
> 
Sorry Jaeguek,
I misunderstood what you wanted. In addition thanks for the quick reply.
Nick

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-07-01  1:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-29 20:07 [PATCH] f2fs:Make the function check_dnode have a return type of bool Nicholas Krause
2015-07-01  0:50 ` Jaegeuk Kim
2015-07-01  0:56   ` nick
2015-07-01  1:08     ` Jaegeuk Kim
2015-07-01  1:14       ` nick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).