From: Gu Zheng <guz.fnst@cn.fujitsu.com>
To: Chao Yu <chao2.yu@samsung.com>
Cc: "'Jaegeuk Kim'" <jaegeuk@kernel.org>,
"'fsdevel'" <linux-fsdevel@vger.kernel.org>,
"'f2fs'" <linux-f2fs-devel@lists.sourceforge.net>
Subject: Re: [f2fs-dev] [PATCH 2/4] f2fs: remove the needless point-cast
Date: Wed, 25 Jun 2014 10:11:09 +0800 [thread overview]
Message-ID: <53AA2FBD.2050602@cn.fujitsu.com> (raw)
In-Reply-To: <002e01cf9018$9f793790$de6ba6b0$@samsung.com>
Hi Yu,
On 06/25/2014 09:55 AM, Chao Yu wrote:
> Hi Gu,
>
> I found kaddr in f2fs_delete_entry is unneeded, maybe this trivial problem
> could be fixed in this patch together. :)
Yeah, I'll add this fix together.;)
Regards,
Gu
>
> Thanks.
>
>> -----Original Message-----
>> From: Gu Zheng [mailto:guz.fnst@cn.fujitsu.com]
>> Sent: Tuesday, June 24, 2014 6:20 PM
>> To: Jaegeuk Kim
>> Cc: fsdevel; f2fs
>> Subject: [f2fs-dev] [PATCH 2/4] f2fs: remove the needless point-cast
>>
>> Signed-off-by: Gu Zheng <guz.fnst@cn.fujitsu.com>
>> ---
>> fs/f2fs/dir.c | 14 ++++++--------
>> 1 files changed, 6 insertions(+), 8 deletions(-)
>>
>> diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
>> index 087b03d..3edd561 100644
>> --- a/fs/f2fs/dir.c
>> +++ b/fs/f2fs/dir.c
>> @@ -298,14 +298,13 @@ static int make_empty_dir(struct inode *inode,
>> struct page *dentry_page;
>> struct f2fs_dentry_block *dentry_blk;
>> struct f2fs_dir_entry *de;
>> - void *kaddr;
>>
>> dentry_page = get_new_data_page(inode, page, 0, true);
>> if (IS_ERR(dentry_page))
>> return PTR_ERR(dentry_page);
>>
>> - kaddr = kmap_atomic(dentry_page);
>> - dentry_blk = (struct f2fs_dentry_block *)kaddr;
>> +
>> + dentry_blk = kmap_atomic(dentry_page);
>>
>> de = &dentry_blk->dentry[0];
>> de->name_len = cpu_to_le16(1);
>> @@ -323,7 +322,7 @@ static int make_empty_dir(struct inode *inode,
>>
>> test_and_set_bit_le(0, &dentry_blk->dentry_bitmap);
>> test_and_set_bit_le(1, &dentry_blk->dentry_bitmap);
>> - kunmap_atomic(kaddr);
>> + kunmap_atomic(dentry_blk);
>>
>> set_page_dirty(dentry_page);
>> f2fs_put_page(dentry_page, 1);
>> @@ -632,7 +631,6 @@ bool f2fs_empty_dir(struct inode *dir)
>> unsigned long nblock = dir_blocks(dir);
>>
>> for (bidx = 0; bidx < nblock; bidx++) {
>> - void *kaddr;
>> dentry_page = get_lock_data_page(dir, bidx);
>> if (IS_ERR(dentry_page)) {
>> if (PTR_ERR(dentry_page) == -ENOENT)
>> @@ -641,8 +639,8 @@ bool f2fs_empty_dir(struct inode *dir)
>> return false;
>> }
>>
>> - kaddr = kmap_atomic(dentry_page);
>> - dentry_blk = (struct f2fs_dentry_block *)kaddr;
>> +
>> + dentry_blk = kmap_atomic(dentry_page);
>> if (bidx == 0)
>> bit_pos = 2;
>> else
>> @@ -650,7 +648,7 @@ bool f2fs_empty_dir(struct inode *dir)
>> bit_pos = find_next_bit_le(&dentry_blk->dentry_bitmap,
>> NR_DENTRY_IN_BLOCK,
>> bit_pos);
>> - kunmap_atomic(kaddr);
>> + kunmap_atomic(dentry_blk);
>>
>> f2fs_put_page(dentry_page, 1);
>>
>> --
>> 1.7.7
>>
>>
>> ------------------------------------------------------------------------------
>> Open source business process management suite built on Java and Eclipse
>> Turn processes into business applications with Bonita BPM Community Edition
>> Quickly connect people, data, and systems into organized workflows
>> Winner of BOSSIE, CODIE, OW2 and Gartner awards
>> http://p.sf.net/sfu/Bonitasoft
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>
> .
>
next prev parent reply other threads:[~2014-06-25 2:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-24 10:19 [PATCH 2/4] f2fs: remove the needless point-cast Gu Zheng
2014-06-25 1:55 ` [f2fs-dev] " Chao Yu
2014-06-25 2:11 ` Gu Zheng [this message]
2014-06-27 9:57 ` [PATCH V2 " Gu Zheng
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=53AA2FBD.2050602@cn.fujitsu.com \
--to=guz.fnst@cn.fujitsu.com \
--cc=chao2.yu@samsung.com \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-fsdevel@vger.kernel.org \
/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).