Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751887AbbD3BjQ (ORCPT ); Wed, 29 Apr 2015 21:39:16 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:59344 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751159AbbD3BjN (ORCPT ); Wed, 29 Apr 2015 21:39:13 -0400 X-AuditID: cbfee61b-f79536d000000f1f-93-554187bf5041 From: Chao Yu To: "'Jaegeuk Kim'" Cc: "'Changman Lee'" , linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org References: <007901d079be$9cfb81e0$d6f285a0$@samsung.com> <20150429213042.GB8429@jaegeuk-mac02.mot.com> In-reply-to: <20150429213042.GB8429@jaegeuk-mac02.mot.com> Subject: RE: [PATCH 1/2] f2fs: support FALLOC_FL_COLLAPSE_RANGE Date: Thu, 30 Apr 2015 09:38:14 +0800 Message-id: <025401d082e6$7650a530$62f1ef90$@samsung.com> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-index: AQCraoV+BTcNq488H4jn4KlzsAcBEwGIO6PKn6K04sA= Content-language: zh-cn X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrFLMWRmVeSWpSXmKPExsVy+t9jAd397Y6hBjeuSFpc29fIZPFk/Sxm i0uL3C0u75rD5sDisWlVJ5vH7gWfmTz6tqxi9Pi8SS6AJYrLJiU1J7MstUjfLoEr49DxRsaC gzwVEw8dYmlg/MjZxcjJISFgIjGh+RwLhC0mceHeerYuRi4OIYFFjBJbJi5gh3BeMUp0f5rJ ClLFJqAisbzjPxOILSKgJtG7bwqQzcHBLFAksWqFAEhYSCBT4vvJLWAlnAJWErcf/GUGsYUF 7CX+rHrPDmKzCKhKPL04EWwxr4ClxKcVE1khbEGJH5PvgcWZBbQk1u88zgRhy0tsXvOWGeJQ BYkdZ18zQpxgJTFh/1qoGnGJjUdusUxgFJqFZNQsJKNmIRk1C0nLAkaWVYyiqQXJBcVJ6blG esWJucWleel6yfm5mxjBMfBMegfjqgaLQ4wCHIxKPLwCug6hQqyJZcWVuYcYJTiYlUR4+Ysc Q4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzztGVCxUSSE8sSc1OTS1ILYLJMnFwSjUwCgmmreg/ us/UctZ3BtlCoQZWrUI72+Ads1d9nrUh7v235/sN5x05xVOXfyHT5vSLcE5dvpAu3ZiXcyfw W3kd/ndb963nkU3t0a1/+c01WvbKJ/P8sV3e7lvp6H9rqe4DHuEEhs3/FvJpTl9jz8rSotv1 rIxvUcXpBwu/FF/vS2y7/y3oRXK+EktxRqKhFnNRcSIAJMpDZn0CAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1801 Lines: 50 Hi Jaegeuk, > -----Original Message----- > From: Jaegeuk Kim [mailto:jaegeuk@kernel.org] > Sent: Thursday, April 30, 2015 5:31 AM > To: Chao Yu > Cc: Changman Lee; linux-f2fs-devel@lists.sourceforge.net; linux-kernel@vger.kernel.org > Subject: Re: [PATCH 1/2] f2fs: support FALLOC_FL_COLLAPSE_RANGE > > Hi Chao, > > On Sat, Apr 18, 2015 at 06:00:36PM +0800, Chao Yu wrote: > > Now, FALLOC_FL_COLLAPSE_RANGE flag in ->fallocate is supported in ext4/xfs. > > > > In commit, the semantics of this flag is descripted as following: > > "1) It collapses the range lying between offset and length by removing any data > > blocks which are present in this range and than updates all the logical > > offsets of extents beyond "offset + len" to nullify the hole created by > > removing blocks. In short, it does not leave a hole. > > 2) It should be used exclusively. No other fallocate flag in combination. > > 3) Offset and length supplied to fallocate should be fs block size aligned > > in case of xfs and ext4. > > 4) Collaspe range does not work beyond i_size." > > > > This patch implements fallocate's FALLOC_FL_COLLAPSE_RANGE for f2fs. > > [snip] > > +void replace_block(struct f2fs_sb_info *sbi, struct f2fs_summary *sum, > > + block_t old_blkaddr, block_t new_blkaddr) > > Seems like we can reuse the code in recover_data_page. > How about adding a generic replace_block(..., bool recover_curseg) for both of > them? Agree, I will do it. Thanks for your review! :) > > For other flow, looks good to me. > > Nice work. > Thanks, -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/