Skip to contentSkip to conversation

GFS2: inline function gfs2_set_mode

PATCH New Bob Peterson 2 participants 2 messages Mar 19, 2014 1 message not in the archive GFS2 file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 GFS2: inline function gfs2_set_mode

Hi,

Here is a revised patch based on Steve's feedback:

This patch eliminates function gfs2_set_mode which was only called in one place, and always returned 0.

Regards,

Bob Peterson
Red Hat File Systems

---

fs/gfs2/acl.c +4 -15
index 394dc55..3088e2a 100644
@@ -64,18 +64,6 @@ struct posix_acl *gfs2_get_acl(struct inode *inode, int type)
 	return acl;
 }
 
-static int gfs2_set_mode(struct inode *inode, umode_t mode)
-{
-	int error = 0;
-
-	if (mode != inode->i_mode) {
-		inode->i_mode = mode;
-		mark_inode_dirty(inode);
-	}
-
-	return error;
-}
-
 int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 {
 	int error;
@@ -98,9 +86,10 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 		if (error == 0)
 			acl = NULL;
 
-		error = gfs2_set_mode(inode, mode);
-		if (error)
-			return error;
+		if (mode != inode->i_mode) {
+			inode->i_mode = mode;
+			mark_inode_dirty(inode);
+		}
 	}
 
 	if (acl) {
#2 lore raw

PATCH 1/1 GFS2: inline function gfs2_set_mode

Hi,

Quoted 7 lines · Bob Peterson

Hi,

Here is a revised patch based on Steve's feedback:

This patch eliminates function gfs2_set_mode which was only called in one place, and always returned 0.

Now in the -nmw tree. Thanks,

Steve.

Quoted 45 lines

Regards,

Bob Peterson
Red Hat File Systems

---

fs/gfs2/acl.c +4 -15
index 394dc55..3088e2a 100644
@@ -64,18 +64,6 @@ struct posix_acl *gfs2_get_acl(struct inode *inode, int type)
 	return acl;
 }
 
-static int gfs2_set_mode(struct inode *inode, umode_t mode)
-{
-	int error = 0;
-
-	if (mode != inode->i_mode) {
-		inode->i_mode = mode;
-		mark_inode_dirty(inode);
-	}
-
-	return error;
-}
-
 int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 {
 	int error;
@@ -98,9 +86,10 @@ int gfs2_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 		if (error == 0)
 			acl = NULL;
 
-		error = gfs2_set_mode(inode, mode);
-		if (error)
-			return error;
+		if (mode != inode->i_mode) {
+			inode->i_mode = mode;
+			mark_inode_dirty(inode);
+		}
 	}
 
 	if (acl) {