From patchwork Wed Jun 22 14:35:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9193121 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 7AC4860756 for ; Wed, 22 Jun 2016 14:38:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BD1928358 for ; Wed, 22 Jun 2016 14:38:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 601252840B; Wed, 22 Jun 2016 14:38:38 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable 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 E1D4628358 for ; Wed, 22 Jun 2016 14:38:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752767AbcFVOhi (ORCPT ); Wed, 22 Jun 2016 10:37:38 -0400 Received: from mail-wm0-f54.google.com ([74.125.82.54]:38349 "EHLO mail-wm0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbcFVOfS (ORCPT ); Wed, 22 Jun 2016 10:35:18 -0400 Received: by mail-wm0-f54.google.com with SMTP id r201so9060260wme.1 for ; Wed, 22 Jun 2016 07:35:17 -0700 (PDT) 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=zIL8P5RrvFRycjszw6a63tD6wvS9suEtqDbwTDW1eD4=; b=iqecC8NGKRHURgzyRoeQwtgxmYHE0kfmXjt+BtTqDkNLc2Eb8e3AaP8DNuExhWxlHV jgJNo1dbJ6pmCw8BMojdhOnSQrSIevuJRkqisZ6IMS01RaW3ACud9LzknY4XK6DGRdDC G+FbOuktuiueVVMMAZhLQYo+DIrKI8AMmQc/q6fR36PK3AeeYKXRH3rfhPrpw21dp9Rh VOrpepkFuFI7PnjzKLlaqfUH6bfQSvpt9drFWh8Z8RDVECkosZCtR+Rk6kr54O+dWkyy S1gGebs0OFL/vsUhVwBsxqZ92cUBSOFkZeDnRoAz4bQckQhx5hJIvtu5CBkhawUEgqv1 c7Vw== X-Gm-Message-State: ALyK8tLKwuxqquh+9/pxshcQZ70YWI7L++7gDcPwdBgUlyqp7TWhvQvFaX9gg4iwZP9VVRGJ X-Received: by 10.194.216.106 with SMTP id op10mr27496772wjc.178.1466606116850; Wed, 22 Jun 2016 07:35:16 -0700 (PDT) Received: from veci.piliscsaba.szeredi.hu (pool-dsl-2c-0018.externet.hu. [217.173.44.24]) by smtp.gmail.com with ESMTPSA id u71sm930666wmu.13.2016.06.22.07.35.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 07:35:15 -0700 (PDT) From: Miklos Szeredi To: Al Viro Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Steve French Subject: [PATCH 3/8] cifs: don't use ->d_time Date: Wed, 22 Jun 2016 16:35:05 +0200 Message-Id: <1466606110-24297-4-git-send-email-mszeredi@redhat.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1466606110-24297-1-git-send-email-mszeredi@redhat.com> References: <1466606110-24297-1-git-send-email-mszeredi@redhat.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 Use d_fsdata instead, which is the same size. Introduce helpers to hide the typecasts. Signed-off-by: Miklos Szeredi Cc: Steve French --- fs/cifs/cifsfs.h | 10 ++++++++++ fs/cifs/dir.c | 6 +++--- fs/cifs/inode.c | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/fs/cifs/cifsfs.h b/fs/cifs/cifsfs.h index 9dcf974acc47..c9c00a862036 100644 --- a/fs/cifs/cifsfs.h +++ b/fs/cifs/cifsfs.h @@ -41,6 +41,16 @@ cifs_uniqueid_to_ino_t(u64 fileid) } +static inline void cifs_set_time(struct dentry *dentry, unsigned long time) +{ + dentry->d_fsdata = (void *) time; +} + +static inline unsigned long cifs_get_time(struct dentry *dentry) +{ + return (unsigned long) dentry->d_fsdata; +} + extern struct file_system_type cifs_fs_type; extern const struct address_space_operations cifs_addr_ops; extern const struct address_space_operations cifs_addr_ops_smallbuf; diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index c3eb998a99bd..49e13ecbdca9 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c @@ -40,7 +40,7 @@ renew_parental_timestamps(struct dentry *direntry) /* BB check if there is a way to get the kernel to do this or if we really need this */ do { - direntry->d_time = jiffies; + cifs_set_time(direntry, jiffies); direntry = direntry->d_parent; } while (!IS_ROOT(direntry)); } @@ -768,7 +768,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, } else if (rc == -ENOENT) { rc = 0; - direntry->d_time = jiffies; + cifs_set_time(direntry, jiffies); d_add(direntry, NULL); /* if it was once a directory (but how can we tell?) we could do shrink_dcache_parent(direntry); */ @@ -828,7 +828,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags) if (flags & (LOOKUP_CREATE | LOOKUP_RENAME_TARGET)) return 0; - if (time_after(jiffies, direntry->d_time + HZ) || !lookupCacheEnabled) + if (time_after(jiffies, cifs_get_time(direntry) + HZ) || !lookupCacheEnabled) return 0; return 1; diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 514dadb0575d..cc916adb49f0 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c @@ -1933,7 +1933,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry) cifs_dbg(FYI, "Update attributes: %s inode 0x%p count %d dentry: 0x%p d_time %ld jiffies %ld\n", full_path, inode, inode->i_count.counter, - dentry, dentry->d_time, jiffies); + dentry, cifs_get_time(dentry), jiffies); if (cifs_sb_master_tcon(CIFS_SB(sb))->unix_ext) rc = cifs_get_inode_info_unix(&inode, full_path, sb, xid);