From patchwork Sat Jun 25 21:37:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 9198753 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 B7C1C6075F for ; Sat, 25 Jun 2016 21:40:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AEB0728527 for ; Sat, 25 Jun 2016 21:40:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2CF32852B; Sat, 25 Jun 2016 21:40:51 +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 3EB3728527 for ; Sat, 25 Jun 2016 21:40:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752125AbcFYVkM (ORCPT ); Sat, 25 Jun 2016 17:40:12 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:33714 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752039AbcFYVir (ORCPT ); Sat, 25 Jun 2016 17:38:47 -0400 Received: by mail-pa0-f67.google.com with SMTP id ts6so11972626pac.0; Sat, 25 Jun 2016 14:38:47 -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=ZfWc4I2FlHLO8hn0MJwBh5nEMLmD5PxEmgCZ0Vt3Z9MOllT8ZlwqvGfk4iAV+JsWZd Onh30M1qoXeIdBYDYDdNJ8ogttFVzUGqK2deTi0Fpr1lsjklKnUmaI9BpcALESVCuuCz AaWp5nkROKGOHBvcqZaCfn9Bl+jm2GLfG9ktrE/OoxHXemZy0jVSwsyHPVDd4ItdGgSv rRPozAHcqJpwx11pno5f7XvmDoRnWWGUZ9VZq09p0khVTnM5ZqaZIrh6ShY7ZB404xgL ZeiyJm+RzAM070BYHwwCQNH514ghTcV9ofIpytqmEDEpmlCwk0e9zyeYHYywEK24j01b CRzQ== 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=X/vk1QFOAWmWDIXrAnIPHyQs46XHnK4rMzK8gRuepSyNWzPI/+Hmd/SbyNebmy37fB +d8StKYgRcVv3TsL5whjK9gTkysXxIJwwryiaQjpsZg9Virz9MWZwixMfQvlodo5BRZd RIhOldo1NbM5LC58Tdcm+1ybEYtshkIPOJmsZ9s+w9aoEoiuvE7A8hlsFOgzaHM1aL7I lD9Z69oq1y0BARgcuvMyn4nJ7yxkD3HoUxvdo8wVJkO+mtAsp4EtxeW7EReIgCrAikBc Lg3BBHZz1gRJ6LASKbo48iAoHzW0givlI0tDtLIIM8XdyKUiUEse0ripOlsImKa049wM bE7A== X-Gm-Message-State: ALyK8tInpd1AejjwcheHX4aWQvd4UmdTXqIMPvuvLEzT/p//z5M5N6VoZQf6jyxU47iLvw== X-Received: by 10.66.67.1 with SMTP id j1mr19630222pat.57.1466890727009; Sat, 25 Jun 2016 14:38:47 -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 m8sm1861308pfi.27.2016.06.25.14.38.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 25 Jun 2016 14:38:46 -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 v3 22/24] fs: ceph: Replace current_fs_time for request stamp Date: Sat, 25 Jun 2016 14:37:46 -0700 Message-Id: <1466890668-23400-23-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1466890668-23400-1-git-send-email-deepa.kernel@gmail.com> References: <1466890668-23400-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;