All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Brandenburg <martin@omnibond.com>
To: hubcap@omnibond.com, devel@lists.orangefs.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Martin Brandenburg <martin@martinbrandenburg.com>
Subject: [PATCH 17/18] orangefs: no more explicit setattr
Date: Tue, 12 Dec 2017 13:34:23 -0500	[thread overview]
Message-ID: <20171212183424.26406-18-martin@martinbrandenburg.com> (raw)
In-Reply-To: <20171212183424.26406-1-martin@martinbrandenburg.com>

Now inodes will be marked dirty and written back at the appopriate time.

Signed-off-by: Martin Brandenburg <martin@martinbrandenburg.com>
---
 fs/orangefs/acl.c             | 11 +++--------
 fs/orangefs/inode.c           | 17 -----------------
 fs/orangefs/namei.c           | 17 -----------------
 fs/orangefs/orangefs-kernel.h |  2 --
 fs/orangefs/symlink.c         |  1 -
 5 files changed, 3 insertions(+), 45 deletions(-)

diff --git a/fs/orangefs/acl.c b/fs/orangefs/acl.c
index 480ea059a680..90c25ae741b2 100644
--- a/fs/orangefs/acl.c
+++ b/fs/orangefs/acl.c
@@ -121,8 +121,6 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 {
 	int error;
 	struct iattr iattr;
-	int rc;
-
 	if (type == ACL_TYPE_ACCESS && acl) {
 		/*
 		 * posix_acl_update_mode checks to see if the permissions
@@ -140,14 +138,11 @@ int orangefs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 		}
 
 		if (acl) {
-			rc = __orangefs_set_acl(inode, acl, type);
+			return __orangefs_set_acl(inode, acl, type);
 		} else {
-			iattr.ia_valid = ATTR_MODE;
-			rc = orangefs_inode_setattr(inode, &iattr);
+			mark_inode_dirty(inode);
+			return 0;
 		}
-
-		return rc;
-
 	} else {
 		return -EINVAL;
 	}
diff --git a/fs/orangefs/inode.c b/fs/orangefs/inode.c
index 231242a4856e..66c40ac7c4ac 100644
--- a/fs/orangefs/inode.c
+++ b/fs/orangefs/inode.c
@@ -115,22 +115,6 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
 	return ret;
 }
 
-int orangefs_update_time(struct inode *inode, struct timespec *time, int flags)
-{
-	struct iattr iattr;
-	gossip_debug(GOSSIP_INODE_DEBUG, "orangefs_update_time: %pU\n",
-	    get_khandle_from_ino(inode));
-	generic_update_time(inode, time, flags);
-	memset(&iattr, 0, sizeof iattr);
-        if (flags & S_ATIME)
-		iattr.ia_valid |= ATTR_ATIME;
-	if (flags & S_CTIME)
-		iattr.ia_valid |= ATTR_CTIME;
-	if (flags & S_MTIME)
-		iattr.ia_valid |= ATTR_MTIME;
-	return orangefs_inode_setattr(inode, &iattr);
-}
-
 /* ORANGEDS2 implementation of VFS inode operations for files */
 const struct inode_operations orangefs_file_inode_operations = {
 	.get_acl = orangefs_get_acl,
@@ -138,7 +122,6 @@ const struct inode_operations orangefs_file_inode_operations = {
 	.setattr = orangefs_setattr,
 	.getattr = orangefs_getattr,
 	.listxattr = orangefs_listxattr,
-	.update_time = orangefs_update_time,
 };
 
 static int orangefs_init_iops(struct inode *inode)
diff --git a/fs/orangefs/namei.c b/fs/orangefs/namei.c
index 37d7d8214e3e..13ef64fd6302 100644
--- a/fs/orangefs/namei.c
+++ b/fs/orangefs/namei.c
@@ -24,7 +24,6 @@ static int orangefs_create(struct inode *dir,
 	struct orangefs_kernel_op_s *new_op;
 	struct orangefs_object_kref ref;
 	struct inode *inode;
-	struct iattr iattr;
 	int ret;
 
 	gossip_debug(GOSSIP_NAME_DEBUG, "%s: %pd\n",
@@ -92,9 +91,6 @@ static int orangefs_create(struct inode *dir,
 		     dentry);
 
 	dir->i_mtime = dir->i_ctime = current_time(dir);
-	memset(&iattr, 0, sizeof iattr);
-	iattr.ia_valid |= ATTR_MTIME;
-	orangefs_inode_setattr(dir, &iattr);
 	mark_inode_dirty_sync(dir);
 	ret = 0;
 out:
@@ -231,7 +227,6 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry)
 	struct inode *inode = dentry->d_inode;
 	struct orangefs_inode_s *parent = ORANGEFS_I(dir);
 	struct orangefs_kernel_op_s *new_op;
-	struct iattr iattr;
 	int ret;
 
 	gossip_debug(GOSSIP_NAME_DEBUG,
@@ -272,9 +267,6 @@ static int orangefs_unlink(struct inode *dir, struct dentry *dentry)
 		drop_nlink(inode);
 
 		dir->i_mtime = dir->i_ctime = current_time(dir);
-		memset(&iattr, 0, sizeof iattr);
-		iattr.ia_valid |= ATTR_MTIME;
-		orangefs_inode_setattr(dir, &iattr);
 		mark_inode_dirty_sync(dir);
 	}
 	return ret;
@@ -288,7 +280,6 @@ static int orangefs_symlink(struct inode *dir,
 	struct orangefs_kernel_op_s *new_op;
 	struct orangefs_object_kref ref;
 	struct inode *inode;
-	struct iattr iattr;
 	int mode = 755;
 	int ret;
 
@@ -363,9 +354,6 @@ static int orangefs_symlink(struct inode *dir,
 		     dentry);
 
 	dir->i_mtime = dir->i_ctime = current_time(dir);
-	memset(&iattr, 0, sizeof iattr);
-	iattr.ia_valid |= ATTR_MTIME;
-	orangefs_inode_setattr(dir, &iattr);
 	mark_inode_dirty_sync(dir);
 	ret = 0;
 out:
@@ -378,7 +366,6 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
 	struct orangefs_kernel_op_s *new_op;
 	struct orangefs_object_kref ref;
 	struct inode *inode;
-	struct iattr iattr;
 	int ret;
 
 	/* Need directory updates to be on server prior to issuing op. */
@@ -444,9 +431,6 @@ static int orangefs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode
 	 * across clients; keep constant at 1.
 	 */
 	dir->i_mtime = dir->i_ctime = current_time(dir);
-	memset(&iattr, 0, sizeof iattr);
-	iattr.ia_valid |= ATTR_MTIME;
-	orangefs_inode_setattr(dir, &iattr);
 	mark_inode_dirty_sync(dir);
 out:
 	return ret;
@@ -530,5 +514,4 @@ const struct inode_operations orangefs_dir_inode_operations = {
 	.setattr = orangefs_setattr,
 	.getattr = orangefs_getattr,
 	.listxattr = orangefs_listxattr,
-	.update_time = orangefs_update_time,
 };
diff --git a/fs/orangefs/orangefs-kernel.h b/fs/orangefs/orangefs-kernel.h
index 9c0b575a16e8..4cabde0a5e9f 100644
--- a/fs/orangefs/orangefs-kernel.h
+++ b/fs/orangefs/orangefs-kernel.h
@@ -407,8 +407,6 @@ int orangefs_setattr(struct dentry *dentry, struct iattr *iattr);
 int orangefs_getattr(const struct path *path, struct kstat *stat,
 		     u32 request_mask, unsigned int flags);
 
-int orangefs_update_time(struct inode *, struct timespec *, int);
-
 /*
  * defined in xattr.c
  */
diff --git a/fs/orangefs/symlink.c b/fs/orangefs/symlink.c
index c08f81af1090..4e72f289d3de 100644
--- a/fs/orangefs/symlink.c
+++ b/fs/orangefs/symlink.c
@@ -14,5 +14,4 @@ const struct inode_operations orangefs_symlink_inode_operations = {
 	.setattr = orangefs_setattr,
 	.getattr = orangefs_getattr,
 	.listxattr = orangefs_listxattr,
-	.update_time = orangefs_update_time,
 };
-- 
2.15.1

  parent reply	other threads:[~2017-12-12 18:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-12 18:34 [PATCH 00/18] orangefs: page cache Martin Brandenburg
2017-12-12 18:34 ` [PATCH 01/18] orangefs: open code short single-use functions Martin Brandenburg
2017-12-12 18:34 ` [PATCH 02/18] orangefs: implement vm_ops->fault Martin Brandenburg
2017-12-12 18:34 ` [PATCH 03/18] orangefs: do not invalidate attributes on inode create Martin Brandenburg
2017-12-12 18:34 ` [PATCH 04/18] orangefs: do not invalidate attribute cache on setattr Martin Brandenburg
2017-12-12 18:34 ` [PATCH 05/18] orangefs: reverse sense of revalidate is-inode-stale test Martin Brandenburg
2017-12-12 18:34 ` [PATCH 06/18] orangefs: move orangefs_address_operations to file.c Martin Brandenburg
2017-12-12 18:34 ` [PATCH 07/18] orangefs: remove orangefs_readpages Martin Brandenburg
2017-12-12 18:34 ` [PATCH 08/18] orangefs: make orangefs_inode_read static Martin Brandenburg
2017-12-12 18:34 ` [PATCH 09/18] orangefs: only set a_ops for regular files Martin Brandenburg
2017-12-12 18:34 ` [PATCH 10/18] orangefs: BUG_ON if i_mode invalid Martin Brandenburg
2017-12-12 18:34 ` [PATCH 11/18] orangefs: remove mapping_nrpages macro Martin Brandenburg
2017-12-12 18:34 ` [PATCH 12/18] orangefs: set up and use backing_dev_info Martin Brandenburg
2017-12-12 18:34 ` [PATCH 13/18] orangefs: inodes linger in cache Martin Brandenburg
2017-12-12 18:34 ` [PATCH 14/18] orangefs: implement direct_IO for the read case Martin Brandenburg
2017-12-12 18:34 ` [PATCH 15/18] orangefs: call generic_file_read_iter Martin Brandenburg
2017-12-12 18:34 ` [PATCH 16/18] orangefs: implement write through the page cache Martin Brandenburg
2017-12-12 18:34 ` Martin Brandenburg [this message]
2017-12-12 18:34 ` [PATCH 18/18] orangefs: implement xattr cache Martin Brandenburg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171212183424.26406-18-martin@martinbrandenburg.com \
    --to=martin@omnibond.com \
    --cc=devel@lists.orangefs.org \
    --cc=hubcap@omnibond.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin@martinbrandenburg.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.