From patchwork Mon Feb 22 15:17:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepa Dinamani X-Patchwork-Id: 8378851 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DB2C6C0553 for ; Mon, 22 Feb 2016 15:23:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BC53A2037C for ; Mon, 22 Feb 2016 15:23:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E833C2042B for ; Mon, 22 Feb 2016 15:23:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753725AbcBVPXa (ORCPT ); Mon, 22 Feb 2016 10:23:30 -0500 Received: from mail-pf0-f175.google.com ([209.85.192.175]:33886 "EHLO mail-pf0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752770AbcBVPX2 (ORCPT ); Mon, 22 Feb 2016 10:23:28 -0500 Received: by mail-pf0-f175.google.com with SMTP id x65so94277777pfb.1; Mon, 22 Feb 2016 07:23:28 -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=sj4FJBt2XJJkl32I5s+CPxKQaZoJ6TRJ/bFzPzijQnU=; b=AMtWYf/rNRyMD6bVHYX/9JXLtPM2tDw71MRVon04v2p8jTqEpNvLALwYdoRI1eXVsW /cBegAvvToIxWMk/s9CPNzJXDewW/cioOfikETEgLbfdtx9XbV89OIBKvuqo5Qh5ikJ4 V3/dm5o3+CdqPqQVKazBHWnJiZl1H4/fbaxklgesiyQkn3HWBk1OtUBFl+WpBK0lXkHj 8mlKzLrF/WaolThFhD6O5TooU68wEjH2Ych0aUJAvERLFza8QfD9NahM7MDjP0gebgQM j/wX8GpEixk9HriEKdeQc1xHqFLHQJJxgptGGAwtzVD8VohA9MYrLH6IwLCn0NXF27DT 9EUw== 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=sj4FJBt2XJJkl32I5s+CPxKQaZoJ6TRJ/bFzPzijQnU=; b=A1zuFdxufLRhCA8Aw/D/WhCbgMdq0m6y48S+sCjemAWSHNBc7LnCfmlqruGO1cPICI KDGjruo00WWHZZRg4IIe3+CIZp7kECY6jPw2uwVBoXYDxWW3WlfoKOgvztBcmDSCl5nx GyrUU40L7MrSjj9iQ4SkBU3azgwYqC5fy/qVtfv9sk/s+nGlynl+CX2hMeY1RJXvroDC n3HcpF4Q19sKb6LBA4WJbtzk08zNtRwG0S1PGf3S5VCkzGFoWh7+pVDjRi5N6ke2gZYz BlPPDAGZ3xRd7c20Xv66GM1j/v6VfAnQ+W6gR/oPlJwpP/WkDSzwxcTxEebnEQ3+lvDX kapw== X-Gm-Message-State: AG10YOQJAj7aihaA7a2ye+OracD6p2rq14Z80DVZs86Lao8a+FTXjRG9IBQv01ZDYDe4ew== X-Received: by 10.98.68.194 with SMTP id m63mr38707340pfi.153.1456154608447; Mon, 22 Feb 2016 07:23:28 -0800 (PST) Received: from localhost.localdomain ([106.51.225.115]) by smtp.gmail.com with ESMTPSA id z3sm37888603par.17.2016.02.22.07.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 22 Feb 2016 07:23:28 -0800 (PST) From: Deepa Dinamani To: linux-fsdevel@vger.kernel.org, y2038@lists.linaro.org Cc: Arnd Bergmann , linux-kernel@vger.kernel.org, Andrew Morton , David Howells , Michal Hocko Subject: [PATCH 6/8] fs: ramfs: Replace CURRENT_TIME by current_fs_time() Date: Mon, 22 Feb 2016 07:17:52 -0800 Message-Id: <1456154274-30487-7-git-send-email-deepa.kernel@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1456154274-30487-1-git-send-email-deepa.kernel@gmail.com> References: <1456154274-30487-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-Spam-Status: No, score=-6.8 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 CURRENT_TIME macro is not appropriate for filesystems as it doesn't use the right granularity for filesystem timestamps. Use current_fs_time() instead. Signed-off-by: Deepa Dinamani Cc: Andrew Morton Cc: David Howells Cc: Michal Hocko --- fs/ramfs/inode.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/fs/ramfs/inode.c b/fs/ramfs/inode.c index 38981b0..ce69aec 100644 --- a/fs/ramfs/inode.c +++ b/fs/ramfs/inode.c @@ -61,7 +61,8 @@ struct inode *ramfs_get_inode(struct super_block *sb, inode->i_mapping->a_ops = &ramfs_aops; mapping_set_gfp_mask(inode->i_mapping, GFP_HIGHUSER); mapping_set_unevictable(inode->i_mapping); - inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; + inode->i_atime = inode->i_mtime = + inode->i_ctime = current_fs_time(sb); switch (mode & S_IFMT) { default: init_special_inode(inode, mode, dev); @@ -93,14 +94,15 @@ struct inode *ramfs_get_inode(struct super_block *sb, static int ramfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) { - struct inode * inode = ramfs_get_inode(dir->i_sb, dir, mode, dev); + struct super_block *sb = dir->i_sb; + struct inode *inode = ramfs_get_inode(sb, dir, mode, dev); int error = -ENOSPC; if (inode) { d_instantiate(dentry, inode); dget(dentry); /* Extra count - pin the dentry in core */ error = 0; - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_fs_time(sb); } return error; } @@ -120,17 +122,18 @@ static int ramfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, static int ramfs_symlink(struct inode * dir, struct dentry *dentry, const char * symname) { + struct super_block *sb = dir->i_sb; struct inode *inode; int error = -ENOSPC; - inode = ramfs_get_inode(dir->i_sb, dir, S_IFLNK|S_IRWXUGO, 0); + inode = ramfs_get_inode(sb, dir, S_IFLNK|S_IRWXUGO, 0); if (inode) { int l = strlen(symname)+1; error = page_symlink(inode, symname, l); if (!error) { d_instantiate(dentry, inode); dget(dentry); - dir->i_mtime = dir->i_ctime = CURRENT_TIME; + dir->i_mtime = dir->i_ctime = current_fs_time(sb); } else iput(inode); }