From patchwork Mon Jun 20 00:27:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9186353 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 00C5160B16 for ; Mon, 20 Jun 2016 00:42:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB7C9200F5 for ; Mon, 20 Jun 2016 00:42:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF826223A1; Mon, 20 Jun 2016 00:42:37 +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=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham 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 9695F205AD for ; Mon, 20 Jun 2016 00:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbcFTAmR (ORCPT ); Sun, 19 Jun 2016 20:42:17 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34907 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751525AbcFTAmP (ORCPT ); Sun, 19 Jun 2016 20:42:15 -0400 Received: by mail-pf0-f196.google.com with SMTP id t190so10243780pfb.2; Sun, 19 Jun 2016 17:42:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ZYFUQZrH80fqjfLRnej0yVjOcMpkaM5PTg/ocB0otb8=; b=Os8ddyR/LUVK+a+SAjTu0ESnL5kheYkpH6VjZb3YYUSW9wUVTGfbmARtj5QtiFdXm1 qk6KXXeVNHKFHlfgYdFk4vYh/HJff+II4zMknnHv98HIejk9Eces8cU2db3dn+QY8ZeV qO4/W+nPbD/fCDdaJQiS5PXp5ncNrfLpGyrN1xxcZ8kfs2FMjfMRp8KZTWKfBTZlfhkk 69Rk9cu/wpH7YfLYE4np0CNp8d/UO/APh4srsomyRUkmnkj/pppUvvVNBhNRYO3iECnH UtFIvf6tE65W8nC/zQhHb5hSBFPGQKHXbwp4y7cnLgTELCK6DmO+Ye9/7DbN35R+yTHd wBPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ZYFUQZrH80fqjfLRnej0yVjOcMpkaM5PTg/ocB0otb8=; b=Q7Xt4eyj6dmkOePjg/2XWcmVpyK4K0/at+MQwFjl7xFOIc5C1Lx2C4sDe577Z5gBwi ojXfDuNrR1iDo+bTSXbAcXqNkHOg6mW+ChS46KkAZ0uz5Hr4WaWSZqi/Mjk+xPpXWTGC 00+M3YCh1S7ls2bSN73DVPAtWEimtekJCbUsXDjfCxFrkKvqm2JXeF/JhlYD3EL2CXBD DhNGfWa8FQaH6XaDAeUfJCiZEjOD2TV/TpXOlyWoSqzz1VSGPD+ObWmZDA8DjZQjZxdO mQZBSKfY3UVh3N+TuYB4djI6dSoLC3xFoZI//zqwyM7Zt6hlCSoRhnZjknsvr9qXzPQv Aj9Q== X-Gm-Message-State: ALyK8tJTWpVgnVDmniHcC3LLLln5/YgbhO9xz6pHgrvji1EPm6M566NaGZXrWGMXCuaTbQ== X-Received: by 10.98.87.138 with SMTP id i10mr18632005pfj.1.1466382522903; Sun, 19 Jun 2016 17:28:42 -0700 (PDT) Received: from deepa-ubuntu.hsd1.ca.comcast.net (c-73-252-251-201.hsd1.ca.comcast.net. [73.252.251.201]) by smtp.gmail.com with ESMTPSA id s12sm34984980pfj.57.2016.06.19.17.28.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Jun 2016 17:28:42 -0700 (PDT) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, tglx@linutronix.de, torvalds@linux-foundation.org, tytso@mit.edu, viro@zeniv.linux.org.uk, y2038@lists.linaro.org, "Yan, Zheng" , Sage Weil , Ilya Dryomov , ceph-devel@vger.kernel.org Subject: [PATCH v2 22/24] fs: ceph: Replace current_fs_time for request stamp Date: Sun, 19 Jun 2016 17:27:21 -0700 Message-Id: <1466382443-11063-23-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466382443-11063-1-git-send-email-deepa.kernel@gmail.com> References: <1466382443-11063-1-git-send-email-deepa.kernel@gmail.com> Sender: ceph-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: ceph-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The current_fs_time() api is being changed to use vfs struct inode* as an argument instead of struct super_block*. Set the new mds client request r_stamp field using ktime_get_real_ts() instead of using current_fs_time(). Also, since r_stamp is used as mtime on the server, use timespec_trunc() to truncate the timestamp, using the right granularity from the superblock. This api will be transitioned to be y2038 safe along with vfs. Signed-off-by: Deepa Dinamani Cc: "Yan, Zheng" Cc: Sage Weil Cc: Ilya Dryomov Cc: ceph-devel@vger.kernel.org --- fs/ceph/mds_client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c index 2103b82..c6cae7a 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1697,6 +1697,7 @@ struct ceph_mds_request * ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) { struct ceph_mds_request *req = kzalloc(sizeof(*req), GFP_NOFS); + struct timespec ts; if (!req) return ERR_PTR(-ENOMEM); @@ -1715,7 +1716,8 @@ ceph_mdsc_create_request(struct ceph_mds_client *mdsc, int op, int mode) init_completion(&req->r_safe_completion); INIT_LIST_HEAD(&req->r_unsafe_item); - req->r_stamp = current_fs_time(mdsc->fsc->sb); + ktime_get_real_ts(&ts); + req->r_stamp = timespec_trunc(ts, mdsc->fsc->sb->s_time_gran); req->r_op = op; req->r_direct_mode = mode;