From patchwork Thu Feb 14 10:00:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Omar Sandoval X-Patchwork-Id: 10812311 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 CE60E13B5 for ; Thu, 14 Feb 2019 10:01:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDC1F2CCD9 for ; Thu, 14 Feb 2019 10:01:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B20F42CCF3; Thu, 14 Feb 2019 10:01:43 +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=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 4FF772CD1B for ; Thu, 14 Feb 2019 10:01:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2395221AbfBNKBA (ORCPT ); Thu, 14 Feb 2019 05:01:00 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:42354 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393583AbfBNKA7 (ORCPT ); Thu, 14 Feb 2019 05:00:59 -0500 Received: by mail-pl1-f195.google.com with SMTP id s1so2890754plp.9 for ; Thu, 14 Feb 2019 02:00:59 -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:mime-version :content-transfer-encoding; bh=Z2bkim4oALul+6F5qJgQ+hdQmsxKs2DCBYbBeQSsMyo=; b=U+ByeJBJKkKv7wQl+AkPzcCp2gG51NQeFSKJVvv5ak3wd2wJUPHFc3XUH8knY+Smr1 MkN7O3zfIgH32rWH4NnPKCEdnvs8UcHHYMEW9Qv9AHJK04pclAndsmd8UgBNFIPYTE8s 4Ph8Qd1uuBdhUcR64OQWfhEZxjzSUOUdHXR17r+558uuaBOF4EIFM1XPn1lfuy3HDKsv 5Fa4tx4GIsUnuS0xLVEm30OxmLhtGKW1KO8bIKAqy+lwjXwm2W1qVdVMqWAIZ9oxiv0B 4KujB8yaxuR7RSEz8GAY8Stlm4HiPRoIQYtrH76FfFfWZGhmRNQtx/CIATZ2lzrXdFwR Htnw== 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:mime-version :content-transfer-encoding; bh=Z2bkim4oALul+6F5qJgQ+hdQmsxKs2DCBYbBeQSsMyo=; b=Vg1UkLFsHtp1DB4rCkBxEIlJeb+HOQG55DC6ZohNWNqcKge51tOZrcmH+7WvJunq9T cXJWreFQ43YvD8rzays0AMlI0Mg7IgjPykiKMy/W034BCQIMydJw4IMgfaEZ7vNpkdZE Vp4Q2IlYAPpmrFVMRHZ7Gd9EtnzZslAI+8HiDDuTvY9qM1iKzVgbU2g6Li7eZ/+wkHQP VgLN3XSyDLsUCSA9g6aFjvHWvGSQzApzHF+r2kdrv5bVHdZFd7N4jrrHxsE9VwDHM/yN SoouyBV/+4ObKhvrA+kThr3jAain6GE7KTxolOILW6WI+v7iQsJVA8FPLQ9gjECZmU5k GZuw== X-Gm-Message-State: AHQUAuaTNxLaDZff89+pi73VfaA3uBpoy2iJrYAp+yxMm+74Sqse/c73 p0MAju+EJgVJP6IWfEgVjHIVtSG0cH8= X-Google-Smtp-Source: AHgI3IZ029eRAvLpKuBfBDOBD2fGCcZenX7szd7aNopMbnHOR619jQy9tKbWmQYngGXkmvpLlA0Rzw== X-Received: by 2002:a17:902:2dc3:: with SMTP id p61mr3206016plb.166.1550138458576; Thu, 14 Feb 2019 02:00:58 -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.00.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Feb 2019 02:00:57 -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 0/6] Allow setting file birth time with utimensat() Date: Thu, 14 Feb 2019 02:00:07 -0800 Message-Id: X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 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: Omar Sandoval Hi, Since statx was added in 4.11, userspace has had an interface for reading btime (file creation time), but no way to set it. This RFC patch series adds support for changing btime with utimensat(). Patch 1 adds the VFS infrastructure, patch 2 adds the support to utimensat() with a new flag, and the rest of the patches add filesystem support; I excluded CIFS for now because I don't have a CIFS setup to test it on. Updating btime is useful for at least a couple of use cases: - Backup/restore programs (my motivation for this feature is btrfs send) - File servers which interoperate with operating systems that allow updating file creation time, including Mac OS [1] and Windows [2] I've also included a man page patch, xfs_io support, and an xfstest. Thoughts on the implementation or the interface? Thanks! 1: https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man2/setattrlist.2.html 2: https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-setfiletime Omar Sandoval (6): fs: add btime to struct iattr fs: add AT_UTIME_BTIME for utimensat() Btrfs: add support for setting btime ext4: add support for setting btime f2fs: add support for setting btime xfs: add support for setting btime fs/attr.c | 6 +++ fs/btrfs/inode.c | 2 + fs/btrfs/super.c | 4 +- fs/ext4/inode.c | 15 +++++- fs/ext4/super.c | 2 +- fs/f2fs/file.c | 19 ++++++-- fs/f2fs/super.c | 2 +- fs/utimes.c | 86 +++++++++++++++++++++------------- fs/xfs/libxfs/xfs_format.h | 2 +- fs/xfs/libxfs/xfs_log_format.h | 2 +- fs/xfs/xfs_iops.c | 11 ++++- fs/xfs/xfs_super.c | 2 +- include/linux/fs.h | 4 ++ include/uapi/linux/fcntl.h | 2 + 14 files changed, 111 insertions(+), 48 deletions(-)