From patchwork Thu Feb 14 10:00:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10812261 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3EF4913B4 for ; Thu, 14 Feb 2019 10:01:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E5EC2CCBE for ; Thu, 14 Feb 2019 10:01:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 221002CCD5; Thu, 14 Feb 2019 10:01:06 +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,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 215E22CCBE for ; Thu, 14 Feb 2019 10:01:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437929AbfBNKBE (ORCPT ); Thu, 14 Feb 2019 05:01:04 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:41686 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438125AbfBNKBD (ORCPT ); Thu, 14 Feb 2019 05:01:03 -0500 Received: by mail-pl1-f196.google.com with SMTP id k15so2896965pls.8 for ; Thu, 14 Feb 2019 02:01:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=z1iJdJ3ICufViigzY8ArSNJ8k4Y0JN5jmw8hA8KfmFU=; b=flSeOV67kqykhRwclnrfrqoGKGW89REoU5Hj3g1pDXyBpBurQb2WVbHnHGfaabPXdH eKSDz9iBLVBH6TXcJNKLXZJap0/h8DRGo8G/gzkD0GUDf8FD/etzCzTTEqkkXDFXIdJc hjVZm9tfRGvQNK419c1V7l8hrPfdXq3wlRMPwfjeufOh/yml3DSYcVPBc2pga/OkMVfF nM5e+JjSOCkBu/xCvjduIggPnLBWzR8qLBjq2dQ2IyilRt/iJvogtDrMC9sgrgvNMDFE 490OtH/PMfgJUxT3sDxj3fMVRc2qOHjshCd52BoIM5c8zvZnS82pGDv5tLy8rBbHrWD1 IQIQ== 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:mime-version:content-transfer-encoding; bh=z1iJdJ3ICufViigzY8ArSNJ8k4Y0JN5jmw8hA8KfmFU=; b=LgdF9ZAXjhKfI8AfsbTre73PDTlEg7juO9iCYUmEd+gKxSIN/oQ98OaXATPcLYkJAd Iv1Ge7I+eJi00sAlBI4KHxDbZ4fo8UJDoI7hUyeiflTjD7b31wsxv3U5Ms5hysTN1Yrf ubtchWdrv379Z/XgYIvi/SgcWAkomgSTv9t2QU9nSGgK7139b08fV2XEmzA/mNTDqSS/ +gVTz2uvADMY8lLVA2r7oveXyJZAfVxU8ALR7KPJbmagiCzoCSJa0ivTlsiK7EQ9dU07 8ptFozPPDKOPcCyiPar7gIy2dvuNjGVNrT132sLmReVNxi33MWjjN8j9owGt1hmIJcDa xSAA== X-Gm-Message-State: AHQUAuaRICf6mrCxAo5JKLmcXMMBPe8xUfIUgV3/FFv1z7PF7DduwSYM wAnX0EFveEYTpVonEOXTnrc0Qg== X-Google-Smtp-Source: AHgI3Ibyqg3SB+jzXjDULbQ1xxmVIWOPdoCIOX55ghDRePdqF29R1HktJeP2hFm85ktvyjbG1CXwlw== X-Received: by 2002:a17:902:31a4:: with SMTP id x33mr3169876plb.198.1550138462471; Thu, 14 Feb 2019 02:01:02 -0800 (PST) Received: from vader.thefacebook.com ([2620:10d:c090:180::1:5849]) by smtp.gmail.com with ESMTPSA id i184sm2686952pfc.41.2019.02.14.02.01.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 02:01:01 -0800 (PST) From: Omar Sandoval To: linux-fsdevel@vger.kernel.org, Al Viro Cc: kernel-team@fb.com, linux-api@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-xfs@vger.kernel.org Subject: [RFC PATCH 3/6] Btrfs: add support for setting btime Date: Thu, 14 Feb 2019 02:00:10 -0800 Message-Id: <60b83d5151d3c80bf73bb257b971aeb66120d4d5.1550136164.git.osandov@fb.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 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 From: Omar Sandoval The Btrfs inode format has always included btime (under the name otime), so setting it is trivial. Signed-off-by: Omar Sandoval --- fs/btrfs/inode.c | 2 ++ fs/btrfs/super.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 5c349667c761..49ad777d8057 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5153,6 +5153,8 @@ static int btrfs_setattr(struct dentry *dentry, struct iattr *attr) if (attr->ia_valid) { setattr_copy(inode, attr); + if (attr->ia_valid & ATTR_BTIME) + BTRFS_I(inode)->i_otime = attr->ia_btime; inode_inc_iversion(inode); err = btrfs_dirty_inode(inode); diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0a3f122dd61f..2af368cad2aa 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -2140,7 +2140,7 @@ static struct file_system_type btrfs_fs_type = { .name = "btrfs", .mount = btrfs_mount, .kill_sb = btrfs_kill_super, - .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA, + .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_HAS_BTIME, }; static struct file_system_type btrfs_root_fs_type = { @@ -2148,7 +2148,7 @@ static struct file_system_type btrfs_root_fs_type = { .name = "btrfs", .mount = btrfs_mount_root, .kill_sb = btrfs_kill_super, - .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA, + .fs_flags = FS_REQUIRES_DEV | FS_BINARY_MOUNTDATA | FS_HAS_BTIME, }; MODULE_ALIAS_FS("btrfs");