From patchwork Wed Nov 17 01:07:52 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 330321 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAH19DrJ009852 for ; Wed, 17 Nov 2010 01:09:13 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933375Ab0KQBJJ (ORCPT ); Tue, 16 Nov 2010 20:09:09 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:37116 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933084Ab0KQBJI (ORCPT ); Tue, 16 Nov 2010 20:09:08 -0500 Received: from m6.gw.fujitsu.co.jp ([10.0.50.76]) by fgwmail5.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id oAH1964A022472 for (envelope-from t-itoh@jp.fujitsu.com); Wed, 17 Nov 2010 10:09:06 +0900 Received: from smail (m6 [127.0.0.1]) by outgoing.m6.gw.fujitsu.co.jp (Postfix) with ESMTP id F17FB45DE52 for ; Wed, 17 Nov 2010 10:09:05 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (s6.gw.fujitsu.co.jp [10.0.50.96]) by m6.gw.fujitsu.co.jp (Postfix) with ESMTP id CBC8F45DE4C for ; Wed, 17 Nov 2010 10:09:05 +0900 (JST) Received: from s6.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id A318F1DB8012 for ; Wed, 17 Nov 2010 10:09:05 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s6.gw.fujitsu.co.jp (Postfix) with ESMTP id 5393D1DB8017 for ; Wed, 17 Nov 2010 10:09:05 +0900 (JST) Received: from m105.css.fujitsu.com (m105 [127.0.0.1]) by m105.s.css.fujitsu.com (Postfix) with ESMTP id 191215E8001; Wed, 17 Nov 2010 10:09:05 +0900 (JST) Received: from T-ITOH1.jp.fujitsu.com (unknown [10.124.101.86]) by m105.s.css.fujitsu.com (Postfix) with SMTP id A62F75E8005; Wed, 17 Nov 2010 10:09:04 +0900 (JST) X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.4.0 Received: from T-ITOH1[10.124.101.86] by T-ITOH1 (FujitsuOutboundMailChecker v1.4.0/9992[10.124.101.86]); Wed, 17 Nov 2010 10:08:12 +0900 (JST) Message-Id: <201011170107.AA00002@T-ITOH1.jp.fujitsu.com> From: Tsutomu Itoh Date: Wed, 17 Nov 2010 10:07:52 +0900 To: chris.mason@oracle.com Cc: linux-btrfs@vger.kernel.org Subject: [PATCH] btrfs-progs: setting of time to the root directory MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 17 Nov 2010 01:09:13 +0000 (UTC) diff -urNp btrfs-progs-unstable/utils.c btrfs-progs-unstable-new/utils.c --- btrfs-progs-unstable/utils.c 2010-11-09 11:46:23.000000000 +0900 +++ btrfs-progs-unstable-new/utils.c 2010-11-16 17:24:08.000000000 +0900 @@ -565,6 +565,7 @@ int btrfs_make_root_dir(struct btrfs_tra { int ret; struct btrfs_inode_item inode_item; + time_t now = time(NULL); memset(&inode_item, 0, sizeof(inode_item)); btrfs_set_stack_inode_generation(&inode_item, trans->transid); @@ -572,6 +573,14 @@ int btrfs_make_root_dir(struct btrfs_tra btrfs_set_stack_inode_nlink(&inode_item, 1); btrfs_set_stack_inode_nbytes(&inode_item, root->leafsize); btrfs_set_stack_inode_mode(&inode_item, S_IFDIR | 0555); + btrfs_set_stack_timespec_sec(&inode_item.atime, now); + btrfs_set_stack_timespec_nsec(&inode_item.atime, 0); + btrfs_set_stack_timespec_sec(&inode_item.ctime, now); + btrfs_set_stack_timespec_nsec(&inode_item.ctime, 0); + btrfs_set_stack_timespec_sec(&inode_item.mtime, now); + btrfs_set_stack_timespec_nsec(&inode_item.mtime, 0); + btrfs_set_stack_timespec_sec(&inode_item.otime, 0); + btrfs_set_stack_timespec_nsec(&inode_item.otime, 0); if (root->fs_info->tree_root == root) btrfs_set_super_root_dir(&root->fs_info->super_copy, objectid);