Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2304128ybd; Thu, 27 Jun 2019 10:05:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqw/0IaYhPfwRNaGH5EsR3FBvU4KrVp8wjNKlfrVapVoySKjxVwMfFTYsGYTPLinRcChinLN X-Received: by 2002:a63:62c3:: with SMTP id w186mr4935486pgb.64.1561655136229; Thu, 27 Jun 2019 10:05:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561655136; cv=none; d=google.com; s=arc-20160816; b=MjtLXiyY2yR9qXiPTanmBmvMUF+sw0CPR5ObdevgXNEHRTPEE69FZQ2RETkrIpkbk9 rSVPfWgurzOv7oKA1c1NHRJ5QC6tnGhtl3fp1tpbrzyXvKH49pODJg6FemBJN3t1JuUi WEbFYheiWZ7Ey1MOqsCz31mHiVvNRvMAB8CGqxGScjrnwjyTeJdlF2PnLBwiQLFdq5L1 rHSOV3L/yya5bOcGjnQqRNY23+xaUXrzkpc7G6u4n0UIwZ3i1K4JagOfvvZZcn8v7nbG H1b3/jU/1mdthdelFGwv+juZT6jlG8Iwl9UeCLMXaugr+OqbF9rIF7lN2X1fm8Wf0QD7 S8GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6EYRpwIh3zFUAGBoGM/TbzUOLE3KJ6lFOkFt1xq7hho=; b=RpW3lyGcXZreCq7ZCSz8nChmWlFHS1tsJXkWtXoKDKNG+fkzzHp/vM8llGHa4DzISJ xFkh17Q3qApog8fbpPkR337ZCkGvb5iKdylj1vUlal9XPGL5TfDz4Lm3Qyq/D+cyLJzn 0NcOpe8vbEORCnFTqyUMaaoqx11tfV64qmkylzhxGcivb1oRX+TqJim+0emxemauIqX5 G/HBJX2WD1fQHXo5VAgLhR3Jssrvf6ZRv08UJHXAR+nLHquLmRyC+TObKyhYHrSioPeN o2+CZGi2uO/qztYBRb9RGg685jPlu4GrpEewsUvpbuRSZCEp5wOiHmJktj5VBi2myWvG HNzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zC1Ze2Dp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si1601704pgc.385.2019.06.27.10.05.15; Thu, 27 Jun 2019 10:05:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=zC1Ze2Dp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726523AbfF0RFG (ORCPT + 99 others); Thu, 27 Jun 2019 13:05:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:52112 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726405AbfF0RFG (ORCPT ); Thu, 27 Jun 2019 13:05:06 -0400 Received: from localhost (unknown [104.132.1.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C257F20659; Thu, 27 Jun 2019 17:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561655105; bh=VtbDzrEliM8ZNaN7HaceyqdJC4IAY9HnrzQS56Uhm2A=; h=From:To:Cc:Subject:Date:From; b=zC1Ze2DpXm5s0+vhbpsM3KmvnE494N6tYjhLyy/LLyEY5Ssc3jod5fPxmSZKRGHSW 63FMhpChlaD9x2wXpVODyZtPmbl8W+zmJfCT1+syTJ97E1LcNgiu4olbdPv/zfpsPi cSSyiXQkFSU14EbrEYw/WzxyZHHR4OeEYtlpVNkU= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: allocate blocks for pinned file Date: Thu, 27 Jun 2019 10:05:04 -0700 Message-Id: <20190627170504.71700-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch allows fallocate to allocate physical blocks for pinned file. Signed-off-by: Jaegeuk Kim --- fs/f2fs/file.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e7c368db8185..cdfd4338682d 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1528,7 +1528,12 @@ static int expand_inode_data(struct inode *inode, loff_t offset, if (off_end) map.m_len++; - err = f2fs_map_blocks(inode, &map, 1, F2FS_GET_BLOCK_PRE_AIO); + if (f2fs_is_pinned_file(inode)) + map.m_seg_type = CURSEG_COLD_DATA; + + err = f2fs_map_blocks(inode, &map, 1, (f2fs_is_pinned_file(inode) ? + F2FS_GET_BLOCK_PRE_DIO : + F2FS_GET_BLOCK_PRE_AIO)); if (err) { pgoff_t last_off; -- 2.19.0.605.g01d371f741-goog