Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2964309imm; Sun, 7 Oct 2018 16:29:20 -0700 (PDT) X-Google-Smtp-Source: ACcGV63T9TC0O5DIqI7EbjTxTkIiWUmPCfjePOCgZM3bUveQhlH/M2mX3T6xtIsOes9WT849PILY X-Received: by 2002:a17:902:6a2:: with SMTP id 31-v6mr20712629plh.1.1538954960008; Sun, 07 Oct 2018 16:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538954959; cv=none; d=google.com; s=arc-20160816; b=ofLL0sk8ugDv3cIzasGYaE8gd3so9VDDqqPPKvQERnHL628+ErnjbC4SA2XMYEXwKy ZSuS/6Mr8NGPaFEAA6inT9R3EV4wVyKmWgLBFwsCbAAy3txQw9Zgveh2/N3WLZvd25/3 EETwHDwjye4CGoQvdTXhYh7Gu54U/+DWuJBn06u7cwZd3twFm0LmIPTa7tgJAhsWY/JJ L/TRIkNy5bKrga1aRQSB5lqyd9LCxqviVsloCUst1n4H1KlYT30tjZjo21dVVUmolFWi taMIA9kkFLAm27dt9YLatdhaxupkJFWqh6AYZWil9bPMvMc5W7o7qmy4F7bjOpMOmhYo w9oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4WJ51dxv+psxts3n9n4dYDWv3yfTVCNwV6wMKD8V5fQ=; b=qZgP+Sz0H/Gn/Fs34gzVUK6aGs868r6LtqBl5jewsWcqcQPotJrvbFnp+iS05xqAw1 auXfxdl5wQa/V5HqGlv0iiwprI17+e4K7rwRM6StB4CDnoBz4xecGr2z1V5t1XFlFXuw KjvYJNeQKp9t+KuVUWzj2hFBOeN9Wg6zx/k7Z8sJ35qv/4DpCnWjKAhBN63ENmEd3ByP HRknIpcvHPCbYNbnZMm0tXaGYT1WScFMMYRQC0vJ5M2p+9M2cEmBNjvTDvvmFRsMg3pP M8sTHWN8Q4pnZUPYRKtmbC4Y2Dg8ItUuWBKfSGL7WBAKK6cerMVyaXEX3prXxNA+WMDF Ffhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@omnibond-com.20150623.gappssmtp.com header.s=20150623 header.b=zfUhOYRO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p8-v6si16925899plq.136.2018.10.07.16.28.36; Sun, 07 Oct 2018 16:29:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@omnibond-com.20150623.gappssmtp.com header.s=20150623 header.b=zfUhOYRO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728041AbeJHGg6 (ORCPT + 99 others); Mon, 8 Oct 2018 02:36:58 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:36753 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727087AbeJHGg4 (ORCPT ); Mon, 8 Oct 2018 02:36:56 -0400 Received: by mail-qk1-f194.google.com with SMTP id a85-v6so11101136qkg.3 for ; Sun, 07 Oct 2018 16:28:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=omnibond-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4WJ51dxv+psxts3n9n4dYDWv3yfTVCNwV6wMKD8V5fQ=; b=zfUhOYROVY8mQuZy4xg+kW8T4vvTTob1fwOEL0lBEpDnq5cE2ghriFb5FsXkwsAxIr rXA2P7Y4IGT0jr3kPWxy8/llSQcUS6ERkZ1c7U9eSM6uTbNcLJvMx4gPkCXyJguo8RA8 lISO+2U2ECVyOX/YFQpuAH9342hqWH83gmsysHapPUR/ty/VZUAaTkmabbyWa59N44s2 Jbvi9lff5+yVxO1Jz6AYzBNlQGwHlF/tCmq3b9njE3+rESUougHDkDELtCUvxbfc3faO 4w+NedyQ/hE4QSrNQjFJMqkEoBbca/mgViSpQziw6JLbDNLxnx2ovtyWR3XGLfUD4egP xP9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4WJ51dxv+psxts3n9n4dYDWv3yfTVCNwV6wMKD8V5fQ=; b=d6Yx8rkZxIIKrElFdLAs6jT6dxl93cYvHxZrnXvCzqppahNWLahFU5PJT8Ol4THchH WzYEh4ON1w7FRkRAfGsu2zB67ytBRKfr21W9jQbAYVoLZ0qZmloBXzGwprai3Qw0jupq Y9m2/qhMXSJVw47mc6fFD3twDtRjV5RAhW2EQrM4/YpXQ3p8v3MHmmU+ru9Lw6b6jUF6 Wd+n2wUn1lV0xSw6JVg6w+W4/gLok8hByzfjcMWCzGJ80xh+C/vUQ8jqsnATQi3YzXzI x6LHycXfMOryq65dWQwc0AJnYRlonTcuD9XKtSVn97pNVZlMg09goY4RLs8kmXvku+ei I4GQ== X-Gm-Message-State: ABuFfohcsH2u87YFvnLdc49K5dIux5aI1dpFDRD6PXpWmbyxz3nKVsWO LAnn1QHUnt9DKI7NdTRvnxyKCQ== X-Received: by 2002:a37:c050:: with SMTP id o77-v6mr16771688qki.228.1538954883978; Sun, 07 Oct 2018 16:28:03 -0700 (PDT) Received: from ip-172-31-22-34.ec2.internal (ec2-35-153-175-159.compute-1.amazonaws.com. [35.153.175.159]) by smtp.gmail.com with ESMTPSA id x38-v6sm6793915qtc.39.2018.10.07.16.28.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 07 Oct 2018 16:28:02 -0700 (PDT) From: Martin Brandenburg To: devel@lists.orangefs.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, hubcap@omnibond.com Cc: Martin Brandenburg Subject: [PATCH 07/19] orangefs: let setattr write to cached inode Date: Sun, 7 Oct 2018 23:27:24 +0000 Message-Id: <20181007232736.3780-8-martin@omnibond.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181007232736.3780-1-martin@omnibond.com> References: <20181007232736.3780-1-martin@omnibond.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a fairly big change, but ultimately it's not a lot of code. Implement write_inode and then avoid the call to orangefs_inode_setattr within orangefs_setattr. Signed-off-by: Martin Brandenburg --- fs/orangefs/inode.c | 11 +++-------- fs/orangefs/super.c | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c index ec3996a61f92..b16b11294573 100644 --- a/fs/orangefs/inode.c +++ b/fs/orangefs/inode.c @@ -207,8 +207,8 @@ static int orangefs_setattr_size(struct inode *inode, struct iattr *iattr) */ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr) { - int ret = -EINVAL; struct inode *inode = dentry->d_inode; + int ret; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %pd\n", @@ -228,16 +228,11 @@ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr) setattr_copy(inode, iattr); mark_inode_dirty(inode); - ret = orangefs_inode_setattr(inode, iattr); - gossip_debug(GOSSIP_INODE_DEBUG, - "%s: orangefs_inode_setattr returned %d\n", - __func__, - ret); - - if (!ret && (iattr->ia_valid & ATTR_MODE)) + if (iattr->ia_valid & ATTR_MODE) /* change mod on a file that has ACLs */ ret = posix_acl_chmod(inode, inode->i_mode); + ret = 0; out: gossip_debug(GOSSIP_INODE_DEBUG, "%s: ret:%d:\n", __func__, ret); return ret; diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c index 61bec955b285..788869c8233b 100644 --- a/fs/orangefs/super.c +++ b/fs/orangefs/super.c @@ -151,6 +151,21 @@ static void orangefs_destroy_inode(struct inode *inode) call_rcu(&inode->i_rcu, orangefs_i_callback); } +int orangefs_write_inode(struct inode *inode, struct writeback_control *wbc) +{ + struct iattr iattr; + gossip_debug(GOSSIP_SUPER_DEBUG, "orangefs_write_inode\n"); + iattr.ia_valid = ATTR_MODE | ATTR_UID | ATTR_GID | ATTR_ATIME | + ATTR_ATIME_SET | ATTR_MTIME | ATTR_MTIME_SET | ATTR_CTIME; + iattr.ia_mode = inode->i_mode; + iattr.ia_uid = inode->i_uid; + iattr.ia_gid = inode->i_gid; + iattr.ia_atime = inode->i_atime; + iattr.ia_mtime = inode->i_mtime; + iattr.ia_ctime = inode->i_ctime; + return orangefs_inode_setattr(inode, &iattr); +} + /* * NOTE: information filled in here is typically reflected in the * output of the system command 'df' @@ -309,6 +324,7 @@ void fsid_key_table_finalize(void) static const struct super_operations orangefs_s_ops = { .alloc_inode = orangefs_alloc_inode, .destroy_inode = orangefs_destroy_inode, + .write_inode = orangefs_write_inode, .drop_inode = generic_delete_inode, .statfs = orangefs_statfs, .remount_fs = orangefs_remount_fs, -- 2.19.0