From patchwork Wed Feb 3 06:07:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8198551 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 75F439F8AA for ; Wed, 3 Feb 2016 06:14:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A97F820172 for ; Wed, 3 Feb 2016 06:14:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C46422022D for ; Wed, 3 Feb 2016 06:14:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756182AbcBCGLs (ORCPT ); Wed, 3 Feb 2016 01:11:48 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33843 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753028AbcBCGLq (ORCPT ); Wed, 3 Feb 2016 01:11:46 -0500 Received: by mail-pf0-f194.google.com with SMTP id 65so538778pfd.1; Tue, 02 Feb 2016 22:11:46 -0800 (PST) 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=nEeeRAfqrrgshQOa3XxAeEQF+hdAfaKBFoAizToPFhE=; b=0KsT2TVjNp9/RgRMby1lEpIN7UnsXQvI/erq51eGDOvQattLq9y6qvksJZRPZvk9Rg +vLo5PcZS0bndKhQpwFAvz6PgufVFgd8Xtb/ha0Ls+zJsVOuBPZlBhSXZeKpmAfX+dpv 9TIW/xmSI/7ty5hWTvL+joLVHt7uWlNkxacmXdzm/wAfGOO0nT3t38n8wIk6o8yD9WtY fWLknd0FEjn7dF8MNi0+DLLjVrIAhHoPwgKnj+fqiSuQ+11bXxtwrXbuspXx1Q2ZiZM/ cAV+3iUbAEkPZAsCho9UuVnXhmVOmncF/rhK6QxaDeuoTjwJqfci4Hu9G1THzwb0sgaV z3YQ== 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=nEeeRAfqrrgshQOa3XxAeEQF+hdAfaKBFoAizToPFhE=; b=jnsQckoZw0x055V9QUwy7TnMcMwxusI2VNUZJSUnZkxVnwhPPjjkroibH/42iBbK2D lGd6B8VwxRRO6KVwd7Fgdb0q3IppQ8fCNrzkTzgAT0e72+Go0O6MCmU/0QfR6MYC9Hge 94K3y0JgOh4wpoL/i09T7YHd0SalhzowUMTm5YVaLYN1yMwwGvgFtCRP2oGdONMMJTaY R0W25Y89mGyL9eszf2j+GQBQD5fb7bIYGoBsVnEBFaMw84sjkaQy4/vsPM4jos+O3BFm h9SUYaTuENBbZknFXa8Xa+Vxc3LKynV+9xLOlirpDg6Fes2C0I2jthUvdAAT6U5r2Won zVkQ== X-Gm-Message-State: AG10YOSnXrDk2M7NnYF26F28a433e0j9w7+mG7KZE3Ocv7CdnDhfDqx9HhNz9tF4VoLMuQ== X-Received: by 10.98.72.215 with SMTP id q84mr5771282pfi.152.1454479906241; Tue, 02 Feb 2016 22:11:46 -0800 (PST) Received: from localhost.localdomain ([106.51.31.224]) by smtp.gmail.com with ESMTPSA id kw10sm6817612pab.0.2016.02.02.22.11.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 02 Feb 2016 22:11:45 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: Arnd Bergmann , Dave Chinner , "Theodore Ts'o" , linux-kernel@vger.kernel.org, Steve French , linux-cifs@vger.kernel.org, samba-technical@lists.samba.org Subject: [PATCH 05/10] fs: cifs: Replace CURRENT_TIME by get_seconds Date: Tue, 2 Feb 2016 22:07:45 -0800 Message-Id: <1454479670-8204-6-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com> References: <1454479670-8204-1-git-send-email-deepa.kernel@gmail.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This is in preparation for the series that transitions filesystem timestamps to use 64 bit time and hence make them y2038 safe. CURRENT_TIME macro will be deleted before merging the aforementioned series. Filesystems will use current_fs_time() instead of CURRENT_TIME. Use get_seconds() here as this is not filesystem time. Only the seconds portion of the timestamp is necessary for timezone calculation using server time. Assume that the difference between server and client times lie in the range INT_MIN..INT_MAX. This is valid because this is the difference between current times between server and client, and the largest timezone difference is in the range of one day. Signed-off-by: Deepa Dinamani Cc: Steve French Cc: linux-cifs@vger.kernel.org Cc: samba-technical@lists.samba.org --- fs/cifs/cifssmb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index 90b4f9f..1a9e43d 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -478,14 +478,14 @@ decode_lanman_negprot_rsp(struct TCP_Server_Info *server, NEGOTIATE_RSP *pSMBr) * this requirement. */ int val, seconds, remain, result; - struct timespec ts, utc; - utc = CURRENT_TIME; + struct timespec ts; + unsigned long utc = get_seconds(); ts = cnvrtDosUnixTm(rsp->SrvTime.Date, rsp->SrvTime.Time, 0); cifs_dbg(FYI, "SrvTime %d sec since 1970 (utc: %d) diff: %d\n", - (int)ts.tv_sec, (int)utc.tv_sec, - (int)(utc.tv_sec - ts.tv_sec)); - val = (int)(utc.tv_sec - ts.tv_sec); + (int)ts.tv_sec, (int)utc, + (int)(utc - ts.tv_sec)); + val = (int)(utc - ts.tv_sec); seconds = abs(val); result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ; remain = seconds % MIN_TZ_ADJ;