Skip to contentSkip to conversation

vfs: Introduce XATTR_SET_MASK

PATCH In review Florian Weimer 1 participant 1 message Jan 21, 2014 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 vfs: Introduce XATTR_SET_MASK

This will be used to separate the xattr operations from the AT_* flags.

---
 fs/xattr.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/xattr.c +3 -1
index 3377dff..9e44641 100644
@@ -24,6 +24,8 @@
 
 #include <asm/uaccess.h>
 
+#define XATTR_SET_MASK (XATTR_CREATE | XATTR_REPLACE)
+
 /*
  * Check permissions for extended attribute access.  This is a bit complicated
  * because different namespaces have very different rules.
@@ -327,7 +329,7 @@ setxattr(struct dentry *d, const char __user *name, const void __user *value,
 	void *vvalue = NULL;	/* If non-NULL, we used vmalloc() */
 	char kname[XATTR_NAME_MAX + 1];
 
-	if (flags & ~(XATTR_CREATE|XATTR_REPLACE))
+	if (flags & ~XATTR_SET_MASK)
 		return -EINVAL;
 
 	error = strncpy_from_user(kname, name, sizeof(kname));
Signature · 1 line
1.8.3.1