From patchwork Thu May 31 18:06:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10441673 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF332602BC for ; Thu, 31 May 2018 18:06:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B9C328F25 for ; Thu, 31 May 2018 18:06:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 908F828F92; Thu, 31 May 2018 18:06:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 29D0228F25 for ; Thu, 31 May 2018 18:06:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755912AbeEaSGp (ORCPT ); Thu, 31 May 2018 14:06:45 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50284 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755928AbeEaSGn (ORCPT ); Thu, 31 May 2018 14:06:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=VJz6Nb0sg2bW4PT+EpfT6kTBexVgQ7jxN2zROZJ3C1I=; b=bOFlG51UgtDFc45tD09NaQiLN SHs3b3xQ/p1/Zg7N/2/uIJk6J2yHJ/jrbuFu/IYjH9fu+ovbpW6A56zb/K6PKapx9AIZz4LbXhogX u5RV0ylbBFuAA1ItF3sqY9ZrvlNRcjOYJc+l12Enx0xRqFSxkiUbbzA5D5+Zvv0MjUePtytOntSVM xTSVFTrfC060PMI7S1KaLpdK6EIboQMlzbt6YApr3rpEoEFqjmTrG7zP/U+j71eELEXwOQE8Qc6am HKAuk9gwUITBB2ev/jMayH52AkydJ5JvHC+a9lUOn2g/pZmOedh5ts9x2bwPtlWVnVGNSKwzfEA+s sbZsw1aWg==; Received: from 213-225-38-123.nat.highway.a1.net ([213.225.38.123] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1fORyD-0003Mv-A1; Thu, 31 May 2018 18:06:41 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 07/13] iomap: move IOMAP_F_BOUNDARY to gfs2 Date: Thu, 31 May 2018 20:06:08 +0200 Message-Id: <20180531180614.21506-8-hch@lst.de> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180531180614.21506-1-hch@lst.de> References: <20180531180614.21506-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just define a range of fs specific flags and use that in gfs2 instead of exposing this internal flag globally. Signed-off-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: Darrick J. Wong --- fs/gfs2/bmap.c | 8 +++++--- include/linux/iomap.h | 9 +++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/fs/gfs2/bmap.c b/fs/gfs2/bmap.c index cbeedd3cfb36..8efa6297e19c 100644 --- a/fs/gfs2/bmap.c +++ b/fs/gfs2/bmap.c @@ -683,6 +683,8 @@ static void gfs2_stuffed_iomap(struct inode *inode, struct iomap *iomap) iomap->type = IOMAP_INLINE; } +#define IOMAP_F_GFS2_BOUNDARY IOMAP_F_PRIVATE + /** * gfs2_iomap_begin - Map blocks from an inode to disk blocks * @inode: The inode @@ -774,7 +776,7 @@ int gfs2_iomap_begin(struct inode *inode, loff_t pos, loff_t length, bh = mp.mp_bh[ip->i_height - 1]; len = gfs2_extent_length(bh->b_data, bh->b_size, ptr, lend - lblock, &eob); if (eob) - iomap->flags |= IOMAP_F_BOUNDARY; + iomap->flags |= IOMAP_F_GFS2_BOUNDARY; iomap->length = (u64)len << inode->i_blkbits; out_release: @@ -846,12 +848,12 @@ int gfs2_block_map(struct inode *inode, sector_t lblock, if (iomap.length > bh_map->b_size) { iomap.length = bh_map->b_size; - iomap.flags &= ~IOMAP_F_BOUNDARY; + iomap.flags &= ~IOMAP_F_GFS2_BOUNDARY; } if (iomap.addr != IOMAP_NULL_ADDR) map_bh(bh_map, inode->i_sb, iomap.addr >> inode->i_blkbits); bh_map->b_size = iomap.length; - if (iomap.flags & IOMAP_F_BOUNDARY) + if (iomap.flags & IOMAP_F_GFS2_BOUNDARY) set_buffer_boundary(bh_map); if (iomap.flags & IOMAP_F_NEW) set_buffer_new(bh_map); diff --git a/include/linux/iomap.h b/include/linux/iomap.h index 13d19b4c29a9..819e0cd2a950 100644 --- a/include/linux/iomap.h +++ b/include/linux/iomap.h @@ -27,8 +27,7 @@ struct vm_fault; * written data and requires fdatasync to commit them to persistent storage. */ #define IOMAP_F_NEW 0x01 /* blocks have been newly allocated */ -#define IOMAP_F_BOUNDARY 0x02 /* mapping ends at metadata boundary */ -#define IOMAP_F_DIRTY 0x04 /* uncommitted metadata */ +#define IOMAP_F_DIRTY 0x02 /* uncommitted metadata */ /* * Flags that only need to be reported for IOMAP_REPORT requests: @@ -36,6 +35,12 @@ struct vm_fault; #define IOMAP_F_MERGED 0x10 /* contains multiple blocks/extents */ #define IOMAP_F_SHARED 0x20 /* block shared with another file */ +/* + * Flags from 0x1000 up are for file system specific usage: + */ +#define IOMAP_F_PRIVATE 0x1000 + + /* * Magic value for addr: */