From patchwork Fri May 30 20:01:42 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 4273861 Return-Path: X-Original-To: patchwork-ocfs2-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 8D25D9F30B for ; Fri, 30 May 2014 20:36:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9221C20397 for ; Fri, 30 May 2014 20:36:11 +0000 (UTC) Received: from aserp1040.oracle.com (aserp1040.oracle.com [141.146.126.69]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82AB120351 for ; Fri, 30 May 2014 20:36:10 +0000 (UTC) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4UKZrrg018603 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 30 May 2014 20:35:54 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4UKZntX011587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 30 May 2014 20:35:49 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WqTWn-0005rk-6h; Fri, 30 May 2014 13:35:49 -0700 Received: from acsinet21.oracle.com ([141.146.126.237]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1WqTCI-0005SH-H7 for ocfs2-devel@oss.oracle.com; Fri, 30 May 2014 13:14:38 -0700 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s4UKEcjB015220 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 30 May 2014 20:14:38 GMT Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.10]) by aserp1030.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s4UKEaXe020349 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 30 May 2014 20:14:37 GMT Received: from wuerfel.lan (HSI-KBW-134-3-133-35.hsi14.kabel-badenwuerttemberg.de [134.3.133.35]) by mrelayeu.kundenserver.de (node=mreue104) with ESMTP (Nemesis) id 0LyDKf-1WnDSp2GFZ-015bn2; Fri, 30 May 2014 22:05:06 +0200 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Date: Fri, 30 May 2014 22:01:42 +0200 Message-Id: <1401480116-1973111-19-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1401480116-1973111-1-git-send-email-arnd@arndb.de> References: <1401480116-1973111-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:sFUluYm6sTJie2D9U1Qd6Kk029jWf5lAXCL1grsHt70 yC5EUNYMX9pNF8ycp3WF1PXcYJNIUqMDC7t8hwSv8WDZDWT1fd WMPt+fvRye7pDx+/UmN1QoR5RoCIqgkDDepZQVd7LcqeyisXUu iZ2oa6ioM4qRJ74UADYRJYitNQWuKH+FtkGS3dbE6pxD04I8DM z4M0Rhs8AbhHlHlxL03+lwSLrDM3rGXcLrcyExy7wuX0XdYKwb tnp7xnQFc9yYDE5y0y62KHdbXSoPO1N9ulWSQjeawsWDwHaa9r HLBmACggGrtfrvMZnYJ4Su+76rBNumv3r5dFaB5XYTG49Z2aJx kCa5KLYT60dJSc9v7LkKZacZfR7yhy0pL97KYJOdW X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=212.227.17.10 ct-class=R4 ct-vol1=-92 ct-vol2=9 ct-vol3=8 ct-risk=29 ct-spam1=33 ct-spam2=9 ct-bulk=29 rcpts=1 size=4384 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=McZV5fPf c=1 sm=1 tr=0 a=hYXe5bIVfpalxFTkgZ7ikA==:117 a=ae3oII+1Zk9WdOexAvHMRA==:17 a=qEdHskGoJ7oA:10 a=AWFseqjuKDcA:10 a=iox4zFpeAAAA:8 a=IXr_WNlcAAAA:8 a=yPCof4ZbAAAA:8 a=edSswdfs6x3E__4lx-QA:9 a=JTMqrY5UvyEA:10 a=n9GBPR9yFnkA :10 a=T5ZRoNnfl4MA:10 X-Sendmail-CT-RefID: str=0001.0A090207.5388E6AD.016C, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-Sendmail-CT-Classification: not spam X-Mailman-Approved-At: Fri, 30 May 2014 13:35:47 -0700 Cc: linux-arch@vger.kernel.org, Arnd Bergmann , ocfs2-devel@oss.oracle.com, Mark Fasheh , hpa@zytor.com, hch@infradead.org, john.stultz@linaro.org, lftan@altera.com, linux-fsdevel@vger.kernel.org, geert@linux-m68k.org, tglx@linutronix.de, joseph@codesourcery.com Subject: [Ocfs2-devel] [RFC 18/32] ocfs2: convert to struct inode_time X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 ocfs2 uses unsigned 34-bit seconds for inode timestamps, which will work for the next 500 years, but the VFS uses struct timespec for timestamps, which is only good until 2038 on 32-bit CPUs. This gets us one small step closer to lifting the VFS limit by using struct inode_time in ocfs2. Signed-off-by: Arnd Bergmann Cc: Mark Fasheh Cc: Joel Becker Cc: ocfs2-devel@oss.oracle.com --- fs/ocfs2/dlmglue.c | 16 ++++++++-------- fs/ocfs2/file.c | 6 +++--- fs/ocfs2/ocfs2.h | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 6bd690b..26913ae 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -2010,7 +2010,7 @@ static void ocfs2_downconvert_on_unlock(struct ocfs2_super *osb, /* LVB only has room for 64 bits of time here so we pack it for * now. */ -static u64 ocfs2_pack_timespec(struct timespec *spec) +static u64 ocfs2_pack_inode_time(struct inode_time *spec) { u64 res; u64 sec = spec->tv_sec; @@ -2050,11 +2050,11 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) lvb->lvb_imode = cpu_to_be16(inode->i_mode); lvb->lvb_inlink = cpu_to_be16(inode->i_nlink); lvb->lvb_iatime_packed = - cpu_to_be64(ocfs2_pack_timespec(&inode->i_atime)); + cpu_to_be64(ocfs2_pack_inode_time(&inode->i_atime)); lvb->lvb_ictime_packed = - cpu_to_be64(ocfs2_pack_timespec(&inode->i_ctime)); + cpu_to_be64(ocfs2_pack_inode_time(&inode->i_ctime)); lvb->lvb_imtime_packed = - cpu_to_be64(ocfs2_pack_timespec(&inode->i_mtime)); + cpu_to_be64(ocfs2_pack_inode_time(&inode->i_mtime)); lvb->lvb_iattr = cpu_to_be32(oi->ip_attr); lvb->lvb_idynfeatures = cpu_to_be16(oi->ip_dyn_features); lvb->lvb_igeneration = cpu_to_be32(inode->i_generation); @@ -2063,7 +2063,7 @@ out: mlog_meta_lvb(0, lockres); } -static void ocfs2_unpack_timespec(struct timespec *spec, +static void ocfs2_unpack_inode_time(struct inode_time *spec, u64 packed_time) { spec->tv_sec = packed_time >> OCFS2_SEC_SHIFT; @@ -2099,11 +2099,11 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) i_gid_write(inode, be32_to_cpu(lvb->lvb_igid)); inode->i_mode = be16_to_cpu(lvb->lvb_imode); set_nlink(inode, be16_to_cpu(lvb->lvb_inlink)); - ocfs2_unpack_timespec(&inode->i_atime, + ocfs2_unpack_inode_time(&inode->i_atime, be64_to_cpu(lvb->lvb_iatime_packed)); - ocfs2_unpack_timespec(&inode->i_mtime, + ocfs2_unpack_inode_time(&inode->i_mtime, be64_to_cpu(lvb->lvb_imtime_packed)); - ocfs2_unpack_timespec(&inode->i_ctime, + ocfs2_unpack_inode_time(&inode->i_ctime, be64_to_cpu(lvb->lvb_ictime_packed)); spin_unlock(&oi->ip_lock); } diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index 2930e23..88deaa6 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -216,7 +216,7 @@ static int ocfs2_sync_file(struct file *file, loff_t start, loff_t end, int ocfs2_should_update_atime(struct inode *inode, struct vfsmount *vfsmnt) { - struct timespec now; + struct inode_time now; struct ocfs2_super *osb = OCFS2_SB(inode->i_sb); if (ocfs2_is_hard_readonly(osb) || ocfs2_is_soft_readonly(osb)) @@ -242,8 +242,8 @@ int ocfs2_should_update_atime(struct inode *inode, return 0; if (vfsmnt->mnt_flags & MNT_RELATIME) { - if ((timespec_compare(&inode->i_atime, &inode->i_mtime) <= 0) || - (timespec_compare(&inode->i_atime, &inode->i_ctime) <= 0)) + if ((inode_time_compare(&inode->i_atime, &inode->i_mtime) <= 0) || + (inode_time_compare(&inode->i_atime, &inode->i_ctime) <= 0)) return 1; return 0; diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index bbec539..11a06e7 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -213,7 +213,7 @@ struct ocfs2_orphan_scan { struct ocfs2_super *os_osb; struct ocfs2_lock_res os_lockres; /* lock to synchronize scans */ struct delayed_work os_orphan_scan_work; - struct timespec os_scantime; /* time this node ran the scan */ + struct inode_time os_scantime; /* time this node ran the scan */ u32 os_count; /* tracks node specific scans */ u32 os_seqno; /* tracks cluster wide scans */ atomic_t os_state; /* ACTIVE or INACTIVE */