From patchwork Tue May 29 14:46:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 10435789 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 7248660327 for ; Tue, 29 May 2018 14:51:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5538E2877E for ; Tue, 29 May 2018 14:51:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 51D25287C1; Tue, 29 May 2018 14:51:17 +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.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable 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 3344E287C1 for ; Tue, 29 May 2018 14:51:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936460AbeE2Ouh (ORCPT ); Tue, 29 May 2018 10:50:37 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53667 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936637AbeE2Oqk (ORCPT ); Tue, 29 May 2018 10:46:40 -0400 Received: by mail-wm0-f65.google.com with SMTP id a67-v6so41218189wmf.3 for ; Tue, 29 May 2018 07:46:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=XWi+eLIeQaNtjCiKmXjChJGRwGJd59/wf9rLuTJsRKg=; b=Mfg3eG3mdrVY/sHgmvMNmcj3G0EJO5rvniIsyUJ1O8j/omg+PqiKsyOLAnJH7uQeno RkXVJUT4S2X6pUMDhgWpscQho+RZu1KB7EpBLZiuqzjqqgZoe3ExCAHHuN+v8zrPvfZY atUJMZ/zcDpnJFHoE0MiBL0jILBd7qRCwE4Hi+TL+brjj+vH6V1e6uX7m4SG0QWTfnKL HAHmU+dkYOp+wnrfxeOoG764NlTy4lPcHobrfwwSi6dWSD0bWHfS6lxxgwKDLLAbRq7d bVn5RQtL3LQp6H+l1RmEQ0rUmgnME5EJTxr6EUGnW8yUCBpnzOh27Lzpmzdl7ROCpmxq +GxA== X-Gm-Message-State: ALKqPweTpUM59CzapNf/nTO87gq+yq4qXL4aQRPmwlwchUlnVOuWBJOT Md3JranKmMN2B2M7EktwGVOhlw== X-Google-Smtp-Source: ADUXVKKBHtH6nlm7hGsEnNqY4+gibvYi9kQqajzpvcBmboW9aNWrHiLxjxUv5wUQgNI5K/Ims6RuLQ== X-Received: by 2002:a1c:ad05:: with SMTP id w5-v6mr11827172wme.28.1527605199856; Tue, 29 May 2018 07:46:39 -0700 (PDT) Received: from veci.piliscsaba.redhat.com (catv-176-63-54-97.catv.broadband.hu. [176.63.54.97]) by smtp.gmail.com with ESMTPSA id n71-v6sm20942227wmi.14.2018.05.29.07.46.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 07:46:39 -0700 (PDT) From: Miklos Szeredi To: linux-unionfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 20/28] ovl: Add an inode flag OVL_CONST_INO Date: Tue, 29 May 2018 16:46:04 +0200 Message-Id: <20180529144612.16675-21-mszeredi@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529144612.16675-1-mszeredi@redhat.com> References: <20180529144612.16675-1-mszeredi@redhat.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vivek Goyal Add an ovl_inode flag OVL_CONST_INO. This flag signifies if inode number will remain constant over copy up or not. This flag does not get updated over copy up and remains unmodifed after setting once. Next patch in the series will make use of this flag. It will basically figure out if dentry is of type ORIGIN or not. And this can be derived by this flag. ORIGIN = (upperdentry && ovl_test_flag(OVL_CONST_INO, inode)). Suggested-by: Amir Goldstein Signed-off-by: Vivek Goyal Reviewed-by: Amir Goldstein Signed-off-by: Miklos Szeredi --- fs/overlayfs/inode.c | 3 +++ fs/overlayfs/overlayfs.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/fs/overlayfs/inode.c b/fs/overlayfs/inode.c index d4e643e9098b..ac1d2a581a6e 100644 --- a/fs/overlayfs/inode.c +++ b/fs/overlayfs/inode.c @@ -883,6 +883,9 @@ struct inode *ovl_get_inode(struct super_block *sb, OVL_I(inode)->redirect = oip->redirect; + if (bylower) + ovl_set_flag(OVL_CONST_INO, inode); + /* Check for non-merge dir that may have whiteouts */ if (is_dir) { if (((upperdentry && lowerdentry) || oip->numlower > 1) || diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h index dcd600201ec8..bde352e414e7 100644 --- a/fs/overlayfs/overlayfs.h +++ b/fs/overlayfs/overlayfs.h @@ -38,6 +38,8 @@ enum ovl_inode_flag { OVL_WHITEOUTS, OVL_INDEX, OVL_UPPERDATA, + /* Inode number will remain constant over copy up. */ + OVL_CONST_INO, }; enum ovl_entry_flag {