From patchwork Fri Feb 26 12:54:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102663 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp699943lbc; Fri, 26 Feb 2016 04:54:48 -0800 (PST) X-Received: by 10.66.62.229 with SMTP id b5mr1838515pas.114.1456491287938; Fri, 26 Feb 2016 04:54:47 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rf10si19799150pab.213.2016.02.26.04.54.47; Fri, 26 Feb 2016 04:54:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753582AbcBZMyq (ORCPT + 30 others); Fri, 26 Feb 2016 07:54:46 -0500 Received: from mout.kundenserver.de ([212.227.126.133]:59718 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751488AbcBZMyo (ORCPT ); Fri, 26 Feb 2016 07:54:44 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0Lj72Q-1a44QO0566-00dBce; Fri, 26 Feb 2016 13:54:18 +0100 From: Arnd Bergmann To: Mike Marshall Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] orangefs: remove unused 'diff' function Date: Fri, 26 Feb 2016 13:54:09 +0100 Message-Id: <1456491255-1111319-1-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 X-Provags-ID: V03:K0:6VPO2djMHMzj3kQVgTC90xYtMmNWdVh1BxKNsQ9CltsYAk7P2K2 0KCJGjKH9t/o9bE18pIHz4l8oJ/IpiBzbD8obN9d/eiH/LKjpdLBVeso9OMU9+dJgpAhh+v DOI9zttRxOkVgdEWiBvaVVDnJDonaAdfMo19913HJexCFZAF/wZ72zW5T/QDNRD1Zhl+K+l UlrpSFEScKkb9REZV2a8g== X-UI-Out-Filterresults: notjunk:1; V01:K0:VzANRqk7ED0=:9ewGdsQcBTy+PEfvy+tM2P muN+F2gTL/wQdsszTBJrCNpzSAW4SpkDKtB5lltz3viv0sTkPZXn4leiX5Bkcm4n3WfzfOFlt iev3XZWLVn/Eblrt0EZFq7zNb9geb4KkZz7NOl5nSau4JhUHSDFzlFrToZ6SEAOHGsbsWGEx1 2TnTcUhg0uQ4s0/xvkO6+EXp4y+MCdMi/8xysItZrSrytXuU0ftelXWr/wC45l+KogksEjNtJ w/XZc7fqf7o5qeZb3nPGrVKiG88aSaUfJY0fLhMteYbubnO2axQ/+DbZsZkEjp8vySviThM/T bMOUTPgKQOygq6OuuZxYVRzyMR/agOCLMoaZQ4LIt4454Z4Ivi7j/M8kY/CX0jKRtoBkVZy7R gELppS+UX6zPWxMxLHJli72/31PM7H5vuZO9Czn7VD0Csmy1vsAgH3RQUK0mUgbbs6KjAQM3F N7lMsYH6eZ0WVX6B4n8nrUtE+wG/vh7PbMpFTP9bbDJgXg1lQSxv7VBZPi4LJ74CkUlA0kgSf ZwBJkKyn0cUCQjtWGmUJcwCuU9Kt8nlmpX0hszT5Jyo6zi4mCjLMGQLcrgqysqa9o+9A5hxnk Bf4/jcoIwNs68E3iQ6wf5fOPytnzGqm/RfYGf0m9IYpZMgstpnxoMQK+kg66tHzK5T0dFzeUE AMtA8Hm9Osx9oHxmS90qsMy0BTUghG9cpJTPEUIZ5YgYamRsUuihTvFzL/HbzZ5dwGJg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org orangefs contains a helper function to calculate the difference between two timeval structures. We are trying to remove all instances of timespec from the kernel, and this one is not used at all, so let's remove it now. Signed-off-by: Arnd Bergmann --- fs/orangefs/orangefs-kernel.h | 11 ----------- 1 file changed, 11 deletions(-) -- 2.7.0 diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 6290c24d8270..9d92c4fc7dbd 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -675,15 +675,4 @@ static inline void orangefs_i_size_write(struct inode *inode, loff_t i_size) #endif } -static inline unsigned int diff(struct timeval *end, struct timeval *begin) -{ - if (end->tv_usec < begin->tv_usec) { - end->tv_usec += 1000000; - end->tv_sec--; - } - end->tv_sec -= begin->tv_sec; - end->tv_usec -= begin->tv_usec; - return (end->tv_sec * 1000000) + end->tv_usec; -} - #endif /* __ORANGEFSKERNEL_H */ From patchwork Fri Feb 26 12:54:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102662 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp700065lbc; Fri, 26 Feb 2016 04:55:03 -0800 (PST) X-Received: by 10.66.139.137 with SMTP id qy9mr1781816pab.57.1456491303014; Fri, 26 Feb 2016 04:55:03 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f90si19862962pff.43.2016.02.26.04.55.02; Fri, 26 Feb 2016 04:55:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753989AbcBZMyv (ORCPT + 30 others); Fri, 26 Feb 2016 07:54:51 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:62673 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753740AbcBZMyt (ORCPT ); Fri, 26 Feb 2016 07:54:49 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue005) with ESMTPA (Nemesis) id 0Mex5B-1aFhki301p-00OZ31; Fri, 26 Feb 2016 13:54:21 +0100 From: Arnd Bergmann To: Mike Marshall Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] orangefs: avoid time conversion function Date: Fri, 26 Feb 2016 13:54:10 +0100 Message-Id: <1456491255-1111319-2-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1456491255-1111319-1-git-send-email-arnd@arndb.de> References: <1456491255-1111319-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:3Qw1zvTRXE5nf9slq6s/HQI560FbZNfmshD9NxGPIncwWXPOB8T Inw5i0hW+lFHAa+297zpXAyERPA9UDZRJMPgJHam2mgNlVh9R/GBT4lbC+Hk2Yg+cDSIXln WnWWLin3iBhZTBlMcZUgOvt8JvqusL/GB7XbnLcTNRlCL2AvIMTX3cDjMiqzH9vz7ImTOsi j/37vbc+9M2MQd/bKqHcw== X-UI-Out-Filterresults: notjunk:1; V01:K0:Xmrc+/2CR54=:SKJQQbMU1OBHj8WOZ1ss59 slLbsHsMDOJIcKuYzHHvYJv8d2pE4+WYl4USitCYiC86aHbF38AHt4/UFhfxkQE8VsTij6ujQ nCfd4BeFNhwwDG1v3iril9yqqfcH3xux4VO83t8rmKmpw3wz60IvB0LVgIIkBvEg/XmQwlrpI cMDF6gjTVNccJzCHOQoXoZuIdQ+mQOBZ27e/u0m9q/H9VsrvFuaa1RHDabYPpUmmkewv4aLCC QUGW1hqZvNcjyh9WvNKgTPcTytkSnRevDPtwT59YHcN+3dxR+/p6VzegxyGQbOW4fv0OAURZ1 2MEmHnq0z5sR+C+TAV7XSn3AxTKis3esMqCmKFWXTyyrauFcVR3+U9yW+ImPZomGWSr4ZxYBH eKCZaVLOlL568miCXRmUYI7TUb1hZoGZMD5loSux8wKOa99FwnwN3doOM1NjrKxbzu1ZzQ7vl TxfpxzLJkYq0s6VlPBlR0y5KmVVifQuhf2751K4q5d9u99cJYS4u0cH7+32YaZ6jHOrCKrVdD xJ920LUgV4k64X+KKgax4VVL1BDjVoJ25IV3iuDmvc9D6cDeIaz9fRarh2GaOklmhYZTcOavK URm4aBUiAd2HaYLDhEderQe4fNd9Ullv10XU/tJ2LZCEwQ7dCjDEU6zAQ4Ob4jm+SxdHB2gfp UEnyED1Ql4QHJyecY0trnseN56r4K8scLS8AcLGYbpPBimAE5AC0r397oOVgWxvaBvXg= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The new orangefs code uses a helper function to read a time field to its private structures from struct iattr. This will conflict with the move to 64-bit timestamps in the kernel and is generally not necessary. This replaces the conversion with a simple cast to time64_t that shows what is going on. As the orangefs-internal representation already uses 64-bit timestamps, there should be no ambiguity to negative values, and the cast ensures that we treat them as times before 1970 on both 32-bit and 64-bit architectures, rather than times after 2038. This patch keeps that behavior. Signed-off-by: Arnd Bergmann --- fs/orangefs/orangefs-kernel.h | 5 ----- fs/orangefs/orangefs-utils.c | 12 +++++------- 2 files changed, 5 insertions(+), 12 deletions(-) -- 2.7.0 diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h index 9d92c4fc7dbd..afb8a03b5793 100644 --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -564,11 +564,6 @@ int orangefs_unmount_sb(struct super_block *sb); bool orangefs_cancel_op_in_progress(struct orangefs_kernel_op_s *op); -static inline __u64 orangefs_convert_time_field(const struct timespec *ts) -{ - return (__u64)ts->tv_sec; -} - int orangefs_normalize_to_errno(__s32 error_code); extern struct mutex devreq_mutex; diff --git a/fs/orangefs/orangefs-utils.c b/fs/orangefs/orangefs-utils.c index 488f3501b09c..8ef9e9646748 100644 --- a/fs/orangefs/orangefs-utils.c +++ b/fs/orangefs/orangefs-utils.c @@ -202,9 +202,9 @@ static int copy_attributes_to_inode(struct inode *inode, inode->i_uid = make_kuid(&init_user_ns, attrs->owner); inode->i_gid = make_kgid(&init_user_ns, attrs->group); - inode->i_atime.tv_sec = (time_t) attrs->atime; - inode->i_mtime.tv_sec = (time_t) attrs->mtime; - inode->i_ctime.tv_sec = (time_t) attrs->ctime; + inode->i_atime.tv_sec = (time64_t) attrs->atime; + inode->i_mtime.tv_sec = (time64_t) attrs->mtime; + inode->i_ctime.tv_sec = (time64_t) attrs->ctime; inode->i_atime.tv_nsec = 0; inode->i_mtime.tv_nsec = 0; inode->i_ctime.tv_nsec = 0; @@ -301,16 +301,14 @@ static inline int copy_attributes_from_inode(struct inode *inode, if (iattr->ia_valid & ATTR_ATIME) { attrs->mask |= ORANGEFS_ATTR_SYS_ATIME; if (iattr->ia_valid & ATTR_ATIME_SET) { - attrs->atime = - orangefs_convert_time_field(&iattr->ia_atime); + attrs->atime = (time64_t)iattr->ia_atime.tv_sec; attrs->mask |= ORANGEFS_ATTR_SYS_ATIME_SET; } } if (iattr->ia_valid & ATTR_MTIME) { attrs->mask |= ORANGEFS_ATTR_SYS_MTIME; if (iattr->ia_valid & ATTR_MTIME_SET) { - attrs->mtime = - orangefs_convert_time_field(&iattr->ia_mtime); + attrs->mtime = (time64_t)iattr->ia_mtime.tv_sec; attrs->mask |= ORANGEFS_ATTR_SYS_MTIME_SET; } }