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: 10812257 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 4212013BF for ; Thu, 14 Feb 2019 10:01:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 333E22CCBE for ; Thu, 14 Feb 2019 10:01:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1CB1E2CD91; Thu, 14 Feb 2019 10:01:04 +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 CFC102CCBE for ; Thu, 14 Feb 2019 10:01:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393093AbfBNKBA (ORCPT ); Thu, 14 Feb 2019 05:01:00 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:36879 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393501AbfBNKA7 (ORCPT ); Thu, 14 Feb 2019 05:00:59 -0500 Received: by mail-pl1-f193.google.com with SMTP id b5so2910835plr.4 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=JxTqOU60ZNahuvYI4lDWSyS1rkCqS6yGDHgFxAex0rIEK1+tGa5C+UkYoKirDXygvC yR7+Hd7/HFL6Tl6kEmaoCV40EF2OZVUoYsydD8bVPQmRiqD7lU5aC44dKn9nNPgVeXRt mSUdDPv2AqVkoXyMErGyQMZYSxjopBlhNRNkDrlYr6+p3SYPdlQ9wNujSs7tKBJyTqGs NGRRSw6O5TMw7IX2m0sF18hMtCnul/3e2b+5TIeI9ZxoLaodkg5P100ewHRablOttR8O sevo86xrw+yqUha0fCiqTPW+qkNrzFs5ik2v6OD0CgsV2+RY+NWKLq//4bTv/T/pCAyi NnkA== X-Gm-Message-State: AHQUAuagIUdA+zdMx3PSaHk7m+aPhTjJWKBKHcJ6Y4WeskcffI2OHkjj 5ulVh5+bscWc4e/5I7FArRy+0Q== 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-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@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(-)