From patchwork Mon Oct 17 08:14:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miklos Szeredi X-Patchwork-Id: 9378649 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 8510B600CA for ; Mon, 17 Oct 2016 08:14:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 788A228FAE for ; Mon, 17 Oct 2016 08:14:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6D48F28FB4; Mon, 17 Oct 2016 08:14:43 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 3057F28FB2 for ; Mon, 17 Oct 2016 08:14:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758217AbcJQIOj (ORCPT ); Mon, 17 Oct 2016 04:14:39 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:36822 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758096AbcJQIO2 (ORCPT ); Mon, 17 Oct 2016 04:14:28 -0400 Received: by mail-lf0-f68.google.com with SMTP id b75so25170461lfg.3 for ; Mon, 17 Oct 2016 01:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=sQ5z0pWXEykwbzinlKQJ/kEQhN2ep2Va/bqS7/vtycs=; b=C6+ibXjQ7ROoOsN6imJRaI3ueH65LaF5RNej16/b0S62gwiNQmVgD7Kbe++o7mrriH Kq3f3bcPjDHuz4x9007WEyFRnqduqT111PvH5nZPCizDbYdJylEi/r5IoDCR5dR4ypba peLPutm4CRsbwmqzk8eHvt9GhWwGi12R2x5MA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=sQ5z0pWXEykwbzinlKQJ/kEQhN2ep2Va/bqS7/vtycs=; b=V8m9wQfrv+c2E6YU50Z5hLcwPajfE0ju3rX5SrlFNJOHg29U7TIc7INnuGTtTQl01r fmRJEN2vtEopGpcf3izfi1iE51d4ZUQTGOYed9v/fwJS2JYUMCkld30g2v9ubD0jhOWk GooByfepcNqZctnuNjzLVccdq7AWeemW0TC66hhiwcD37e7TvJL4K3k/s+blD3GYBiNp uTzmDiNg/cBCSFsIHMPLwp4di0RSXGZs5R2YzLNV8VkXsp/K1W6kPPcTWA0H7lfc0GJW 88w0UnrIIHomdNlGeZOx6qBNuLvjVlpHgx1/vSE/OVlYfgWfKmLyDYgcX4uUkfZZzsig 617A== X-Gm-Message-State: AA6/9RkRfLsCSMqlw39b6C6RMrTJhIbzpEIQB4DG0mp4uBaw4AfoXLUL4afFoyyppGiVzg== X-Received: by 10.28.130.138 with SMTP id e132mr7687682wmd.110.1476692066018; Mon, 17 Oct 2016 01:14:26 -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 b8sm51038874wjq.40.2016.10.17.01.14.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 01:14:25 -0700 (PDT) Date: Mon, 17 Oct 2016 10:14:23 +0200 From: Miklos Szeredi To: Mike Marshall , Martin Brandenburg Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH] orangefs: don't use d_time Message-ID: <20161017081423.GH31239@veci.piliscsaba.szeredi.hu> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.7.0 (2016-08-17) 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 Instead use d_fsdata which is the same size. Hoping to get rid of d_time, which is used by very few filesystems by this time. Signed-off-by: Miklos Szeredi Reviewed-by: Martin Brandenburg --- fs/orangefs/dcache.c | 5 +++-- fs/orangefs/namei.c | 8 ++++---- fs/orangefs/orangefs-kernel.h | 7 +++++++ 3 files changed, 14 insertions(+), 6 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/fs/orangefs/dcache.c +++ b/fs/orangefs/dcache.c @@ -73,7 +73,7 @@ static int orangefs_revalidate_lookup(st } } - dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000; + orangefs_set_timeout(dentry); ret = 1; out_release_op: op_release(new_op); @@ -94,8 +94,9 @@ static int orangefs_revalidate_lookup(st static int orangefs_d_revalidate(struct dentry *dentry, unsigned int flags) { int ret; + unsigned long time = (unsigned long) dentry->d_fsdata; - if (time_before(jiffies, dentry->d_time)) + if (time_before(jiffies, time)) return 1; if (flags & LOOKUP_RCU) --- a/fs/orangefs/namei.c +++ b/fs/orangefs/namei.c @@ -72,7 +72,7 @@ static int orangefs_create(struct inode d_instantiate(dentry, inode); unlock_new_inode(inode); - dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000; + orangefs_set_timeout(dentry); ORANGEFS_I(inode)->getattr_time = jiffies - 1; gossip_debug(GOSSIP_NAME_DEBUG, @@ -183,7 +183,7 @@ static struct dentry *orangefs_lookup(st goto out; } - dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000; + orangefs_set_timeout(dentry); inode = orangefs_iget(dir->i_sb, &new_op->downcall.resp.lookup.refn); if (IS_ERR(inode)) { @@ -322,7 +322,7 @@ static int orangefs_symlink(struct inode d_instantiate(dentry, inode); unlock_new_inode(inode); - dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000; + orangefs_set_timeout(dentry); ORANGEFS_I(inode)->getattr_time = jiffies - 1; gossip_debug(GOSSIP_NAME_DEBUG, @@ -386,7 +386,7 @@ static int orangefs_mkdir(struct inode * d_instantiate(dentry, inode); unlock_new_inode(inode); - dentry->d_time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000; + orangefs_set_timeout(dentry); ORANGEFS_I(inode)->getattr_time = jiffies - 1; gossip_debug(GOSSIP_NAME_DEBUG, --- a/fs/orangefs/orangefs-kernel.h +++ b/fs/orangefs/orangefs-kernel.h @@ -580,4 +580,11 @@ static inline void orangefs_i_size_write #endif } +static inline void orangefs_set_timeout(struct dentry *dentry) +{ + unsigned long time = jiffies + orangefs_dcache_timeout_msecs*HZ/1000; + + dentry->d_fsdata = (void *) time; +} + #endif /* __ORANGEFSKERNEL_H */