From: Fan Li <fanofcode.li@samsung.com>
To: 'Jaegeuk Kim' <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH] f2fs: adjust the way of calculating nat block
Date: Thu, 09 Mar 2017 13:37:09 +0800	[thread overview]
Message-ID: <000c01d29897$48a2fb10$d9e8f130$@samsung.com> (raw)
In-Reply-To: <20170308215600.GF5483@jaegeuk.local>
> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Thursday, March 09, 2017 5:56 AM
> To: Fan Li
> Cc: linux-f2fs-devel@lists.sourceforge.net
> Subject: Re: [f2fs-dev] [PATCH] f2fs: adjust the way of calculating nat block
> 
> On 03/08, Fan Li wrote:
> > use a slightly simpler expression to calculate nat block with nid.
> >
> > Signed-off-by: Fan Li <fanofcode.li@samsung.com>
> > ---
> >  fs/f2fs/node.h | 4 +---
> >  1 file changed, 1 insertion(+), 3 deletions(-)
> >
> > diff --git a/fs/f2fs/node.h b/fs/f2fs/node.h index 2f9603f..f9fb5b8
> > 100644
> > --- a/fs/f2fs/node.h
> > +++ b/fs/f2fs/node.h
> > @@ -200,13 +200,11 @@ static inline pgoff_t current_nat_addr(struct f2fs_sb_info *sbi, nid_t start)
> >         struct f2fs_nm_info *nm_i = NM_I(sbi);
> >         pgoff_t block_off;
> >         pgoff_t block_addr;
> > -       int seg_off;
> >
> >         block_off = NAT_BLOCK_OFFSET(start);
> > -       seg_off = block_off >> sbi->log_blocks_per_seg;
> >
> >         block_addr = (pgoff_t)(nm_i->nat_blkaddr +
> > -               (seg_off << sbi->log_blocks_per_seg << 1) +
> > +               (block_off << 1) -
> 
> NAK. This breaks the behavior.
OK, I'm guessing by "breaks the behavior", you mean make the code hard to understand?
I was concerned the same thing, but with the context, I think most people will be able to
 see right through it, and it saves some calculation, makes code as simple as possible, I
just think maybe it's worthy.
> 
> Thanks,
> 
> >                 (block_off & (sbi->blocks_per_seg - 1)));
> >
> >         if (f2fs_test_bit(block_off, nm_i->nat_bitmap))
> > --
> > 2.7.4
------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
next prev parent reply	other threads:[~2017-03-09  5:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170308054010epcas5p1873bf561bd7ceac17a63a6e6cebb8365@epcas5p1.samsung.com>
2017-03-08  5:39 ` [PATCH] f2fs: adjust the way of calculating nat block Fan Li
2017-03-08 21:56   ` Jaegeuk Kim
2017-03-09  5:37     ` Fan Li [this message]
2017-03-09 11:20       ` Chao Yu
2017-03-09 23:58         ` Jaegeuk Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to='000c01d29897$48a2fb10$d9e8f130$@samsung.com' \
    --to=fanofcode.li@samsung.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
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).