From patchwork Wed Jun 22 14:35:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9193111 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 8395C60756 for ; Wed, 22 Jun 2016 14:37:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7453728358 for ; Wed, 22 Jun 2016 14:37:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 687972840B; Wed, 22 Jun 2016 14:37:32 +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 F29BF28358 for ; Wed, 22 Jun 2016 14:37:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752638AbcFVOhE (ORCPT ); Wed, 22 Jun 2016 10:37:04 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36819 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbcFVOfU (ORCPT ); Wed, 22 Jun 2016 10:35:20 -0400 Received: by mail-wm0-f51.google.com with SMTP id f126so90498918wma.1 for ; Wed, 22 Jun 2016 07:35:19 -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=rgSyF7Vo73dTzQk/jvb5JHwXYtoR9cISzWoOT15oaXk=; b=K66KLiiX0YGdq1iLri9c6JSZQlMioDOmAE7Preo45Q+r58/nK/sH07zCP3aKhLu4GC HytJAo/tWRq1PFMNPkeFL4nSTfMO0JiJEC681FhstNRcSzEzUFJtEAs+WpHO88qV4I/y Q7gw+R1DwplaC6lv0Wb5WEr5n/E/6a0hKKu1yu7WEu+FY6BIE4dM0yvo5VB2pnlkff6q asggR3icC6kRUapFnfiL34JQCTPefWzFfbqSbjKSbPbYMddGfEOFC/I2NyyBjByZ/HzW gL+WY5x4mjWAP9jM5dfd+HUf+HGal5xv4VZesY7xWiY8NYBKQkWIQBcRzsvU2Lv5KdCc bojg== X-Gm-Message-State: ALyK8tIuOmXWdAzKdSlNY/ydo6xXcKtdOjifvjQtjfdg7dzHe5NkzlSz4gi3L6j+UdxDP3+h X-Received: by 10.194.222.137 with SMTP id qm9mr15224480wjc.80.1466606118398; Wed, 22 Jun 2016 07:35:18 -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.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2016 07:35:17 -0700 (PDT) From: Miklos Szeredi To: Al Viro Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, OGAWA Hirofumi Subject: [PATCH 4/8] vfat: don't use ->d_time Date: Wed, 22 Jun 2016 16:35:06 +0200 Message-Id: <1466606110-24297-5-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: OGAWA Hirofumi --- fs/fat/namei_vfat.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 7092584f424a..cb27cd818572 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c @@ -21,6 +21,17 @@ #include #include "fat.h" +static inline unsigned long vfat_d_version(struct dentry *dentry) +{ + return (unsigned long) dentry->d_fsdata; +} + +static inline void vfat_d_version_set(struct dentry *dentry, + unsigned long version) +{ + dentry->d_fsdata = (void *) version; +} + /* * If new entry was created in the parent, it could create the 8.3 * alias (the shortname of logname). So, the parent may have the @@ -33,7 +44,7 @@ static int vfat_revalidate_shortname(struct dentry *dentry) { int ret = 1; spin_lock(&dentry->d_lock); - if (dentry->d_time != d_inode(dentry->d_parent)->i_version) + if (vfat_d_version(dentry) != d_inode(dentry->d_parent)->i_version) ret = 0; spin_unlock(&dentry->d_lock); return ret; @@ -759,7 +770,7 @@ static struct dentry *vfat_lookup(struct inode *dir, struct dentry *dentry, out: mutex_unlock(&MSDOS_SB(sb)->s_lock); if (!inode) - dentry->d_time = dir->i_version; + vfat_d_version_set(dentry, dir->i_version); return d_splice_alias(inode, dentry); error: mutex_unlock(&MSDOS_SB(sb)->s_lock); @@ -823,7 +834,7 @@ static int vfat_rmdir(struct inode *dir, struct dentry *dentry) clear_nlink(inode); inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; fat_detach(inode); - dentry->d_time = dir->i_version; + vfat_d_version_set(dentry, dir->i_version); out: mutex_unlock(&MSDOS_SB(sb)->s_lock); @@ -849,7 +860,7 @@ static int vfat_unlink(struct inode *dir, struct dentry *dentry) clear_nlink(inode); inode->i_mtime = inode->i_atime = CURRENT_TIME_SEC; fat_detach(inode); - dentry->d_time = dir->i_version; + vfat_d_version_set(dentry, dir->i_version); out: mutex_unlock(&MSDOS_SB(sb)->s_lock);