Skip to contentSkip to conversation

orangefs: report attributes_mask and attributes for statx

PATCH In review Martin Brandenburg 2 participants 2 messages May 4, 2018 – May 7, 2018

Subsystems (2)
lore
Share & tools
lore

Martin Brandenburg

author reviewer
#0 lore raw

PATCH 1/1 orangefs: report attributes_mask and attributes for statx

---
 fs/orangefs/inode.c | 7 +++++++
 1 file changed, 7 insertions(+)
fs/orangefs/inode.c +7 -0
index b583fbf90665..f301e4957659 100644
@@ -268,6 +268,13 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
 		else
 			stat->result_mask = STATX_BASIC_STATS &
 			    ~STATX_SIZE;
+
+		stat->attributes_mask = STATX_ATTR_IMMUTABLE |
+		    STATX_ATTR_APPEND;
+		if (inode->i_flags & S_IMMUTABLE)
+			stat->attributes |= STATX_ATTR_IMMUTABLE;
+		if (inode->i_flags & S_APPEND)
+			stat->attributes |= STATX_ATTR_APPEND;
 	}
 	return ret;
 }
Signature · 1 line
2.14.3
#1 lore raw

Hi Martin,

Quoted 3 lines · Martin Brandenburg

Probably some commit message would help understand others(like me who are new at this) what this patch is about. I could not follow your patch until I read about statx by (
git log --grep=STATX_ATTR_IMMUTABLE)

Thanks for your help!!

Quoted 23 lines
---
  fs/orangefs/inode.c | 7 +++++++
  1 file changed, 7 insertions(+)
fs/orangefs/inode.c +7 -0
index b583fbf90665..f301e4957659 100644
@@ -268,6 +268,13 @@ int orangefs_getattr(const struct path *path, struct kstat *stat,
  		else
  			stat->result_mask = STATX_BASIC_STATS &
  			    ~STATX_SIZE;
+
+		stat->attributes_mask = STATX_ATTR_IMMUTABLE |
+		    STATX_ATTR_APPEND;
+		if (inode->i_flags & S_IMMUTABLE)
+			stat->attributes |= STATX_ATTR_IMMUTABLE;
+		if (inode->i_flags & S_APPEND)
+			stat->attributes |= STATX_ATTR_APPEND;
  	}
  	return ret;
  }
Signature · 2 lines
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.