From patchwork Thu Jan 8 10:52:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Samuel X-Patchwork-Id: 5591821 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0AFF3BF6C3 for ; Thu, 8 Jan 2015 10:52:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3A0052037D for ; Thu, 8 Jan 2015 10:52:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E65CA20142 for ; Thu, 8 Jan 2015 10:52:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756420AbbAHKwh (ORCPT ); Thu, 8 Jan 2015 05:52:37 -0500 Received: from csamuel.org ([74.50.50.137]:33835 "EHLO csamuel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756383AbbAHKwf (ORCPT ); Thu, 8 Jan 2015 05:52:35 -0500 Received: from localhost (localhost [127.0.0.1]) by csamuel.org (Postfix) with ESMTP id 61130406B8; Thu, 8 Jan 2015 21:52:34 +1100 (AEDT) Received: from csamuel.org ([127.0.0.1]) by localhost (csamuel.org [127.0.0.1]) (amavisd-maia, port 10024) with LMTP id 19858-06; Thu, 8 Jan 2015 21:52:34 +1100 (AEDT) Received: from quad.localnet (2001-44b8-41dd-d500-3512-4f2b-64e2-a635.static.ipv6.internode.on.net [IPv6:2001:44b8:41dd:d500:3512:4f2b:64e2:a635]) by csamuel.org (Postfix) with ESMTPSA id F2DAD406B1; Thu, 8 Jan 2015 21:52:33 +1100 (AEDT) From: Chris Samuel To: linux-btrfs@vger.kernel.org, dsterba@suse.cz Cc: Lennart Poettering Subject: Re: btrfs_inode_item's otime? Date: Thu, 08 Jan 2015 21:52:30 +1100 Message-ID: <2188846.ArnMyWRJKN@quad> User-Agent: KMail/4.14.2 (Linux/3.18.1-031801-generic; KDE/4.14.2; x86_64; ; ) In-Reply-To: <20150106184100.GF24104@twin.jikos.cz> References: <20150105172152.GB19126@gardel-login> <3797928.30urVis5AR@quad> <20150106184100.GF24104@twin.jikos.cz> MIME-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Dave, Sorry for the delay, took a while to poke around the code to figure out possible ways it would get done (and what the right structure was). On Tue, 6 Jan 2015 07:41:00 PM David Sterba wrote: > Set the otime in btrfs_new_inode after the call to fill_inode_item. Hmm, so something like this then? Unfortunately I won't have a test system to try this on for a little while. diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index e687bb0..60bcc72 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -5835,6 +5835,11 @@ static struct inode *btrfs_new_inode(struct btrfs_trans_handle *trans, sizeof(*inode_item)); fill_inode_item(trans, path->nodes[0], inode_item, inode); + /* + * Set the creation time on the inode. + */ + btrfs_set_stack_timespec_sec( &inode.otime, cur_time.tv_sec ); + if (name) { ref = btrfs_item_ptr(path->nodes[0], path->slots[0] + 1, struct btrfs_inode_ref);