From patchwork Sat Aug 13 22:48:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9278763 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 A98146086A for ; Sun, 14 Aug 2016 10:45:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9884A28A13 for ; Sun, 14 Aug 2016 10:45:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8D31028A1E; Sun, 14 Aug 2016 10:45:31 +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 3D4DA28A1A for ; Sun, 14 Aug 2016 10:45:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753108AbcHNKpP (ORCPT ); Sun, 14 Aug 2016 06:45:15 -0400 Received: from mail-pa0-f66.google.com ([209.85.220.66]:33538 "EHLO mail-pa0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752807AbcHNKpN (ORCPT ); Sun, 14 Aug 2016 06:45:13 -0400 Received: by mail-pa0-f66.google.com with SMTP id vy10so2029807pac.0; Sun, 14 Aug 2016 03:45:13 -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=2wbRhM+z+54nbCZiXTNrYvxOzRGmvQSl2KiH4K0RUAU=; b=0alZAAgT+xv76DjTAF8h0HQ7TtXW4tiXFxR2AgJKQeZ185o0gpkGEX+HS5DF1GTQuQ NQzNXeso0X+hO5024ria5uK8A+mTEDkoOcRA/7g7XZq2AAUW61P89yYtfR4rQk8ebUpu ddLLQBLSXhpKOLnG4QW49f6U7yX0fc2R/v+cTKB66CQXeM7PaXszk+GLmc1t6qCry32S ShvqT2GcMugAAvT/L7oIfTCfzZFZNa9q8j9i2zJkwzW82SyfUiwcitALBvHK6Zn0epSU od/bs7BVb54TQLrET/XLfojAkW6UDncQFXFjeB3EHJupktqeKWGnjDslI71Ud82HQdOl 36aA== 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=2wbRhM+z+54nbCZiXTNrYvxOzRGmvQSl2KiH4K0RUAU=; b=DV5sW3lFjbuhmERrbWU/jfjzanPx1GijUVbx8l06iVDFz2vSfi5G/q1LFGFEl0MYI/ 1XGDhL4d/8ydZ5JuDQbLtR6e1qh//jjDEoi4edErKt8C46yRM+fHAHMawwjVBegwZwaU US3BO3AlTAx/pBW/K6BxERXzVPkEPyet3QLfvkY2lZd6rNZGtMny6BRZ97y3lQmSUwvS O4hqjhRQ+oCGQRnomJBkGfKdS/l/wXGAWj+zd1ESg7Ix0CEPhWI8X7O3JaPo+m2RE3Sg HTXYlfQteJZWblXV/bDFKNKzKyOkg7N2FRvQ35pl4src4FZpPhtbL5Y0CAj1uyqN/L1/ 42AA== X-Gm-Message-State: AEkooutxtP+lQ01qcoTw/cdiPC5/29T4hWpF+E+iTe/5tB5nBLhSBuJSpS0B5Gx22soOuQ== X-Received: by 10.66.54.229 with SMTP id m5mr39638833pap.91.1471128582219; Sat, 13 Aug 2016 15:49: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 81sm22528007pfm.90.2016.08.13.15.49.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 13 Aug 2016 15:49:41 -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 v4 23/26] fs: ceph: Replace current_fs_time for request stamp Date: Sat, 13 Aug 2016 15:48:35 -0700 Message-Id: <1471128518-24075-24-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> References: <1471128518-24075-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 Reviewed-by: Arnd Bergmann 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 fa59a85..015db39 100644 --- a/fs/ceph/mds_client.c +++ b/fs/ceph/mds_client.c @@ -1640,6 +1640,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); @@ -1658,7 +1659,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;