summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2015-12-07 16:24:15 +0000
committerNiels de Vos <ndevos@redhat.com>2016-05-11 11:23:00 -0700
commitb2222c1e13d3bff17fa04b8f9b4870cefd457fe2 (patch)
treea2f5b7fca493f9c71a5906ec4e3763ebbd9e77bd /libglusterfs
parent163568951746f7a7af181bb8c592404581eced78 (diff)
upcall: Add support to invalidate xattrs
When SElinux is used, clients should get a notification that the extended attributes have been updated. Other components (like md-cache) will be able to use this too. A big part of the implementation comes from Poornima through the first version of http://review.gluster.org/12996. Also moving the flags from upcall-cache-invalidation.h to the main libglusterfs upcall-utils.h file, so that other places can easily use them in future. Change-Id: I525345bed8f22d029524ff19ccaf726a2c905454 BUG: 1211863 Signed-off-by: Niels de Vos <ndevos@redhat.com> Signed-off-by: Poornima G <pgurusid@redhat.com> Reviewed-on: http://review.gluster.org/12995 Reviewed-by: soumya k <skoduri@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/upcall-utils.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/libglusterfs/src/upcall-utils.h b/libglusterfs/src/upcall-utils.h
index 7acfff15a0b..a4eaabf2032 100644
--- a/libglusterfs/src/upcall-utils.h
+++ b/libglusterfs/src/upcall-utils.h
@@ -15,6 +15,46 @@
#include "compat-uuid.h"
#include "compat.h"
+/* Flags sent for cache_invalidation */
+#define UP_NLINK 0x00000001 /* update nlink */
+#define UP_MODE 0x00000002 /* update mode and ctime */
+#define UP_OWN 0x00000004 /* update mode,uid,gid and ctime */
+#define UP_SIZE 0x00000008 /* update fsize */
+#define UP_TIMES 0x00000010 /* update all times */
+#define UP_ATIME 0x00000020 /* update atime only */
+#define UP_PERM 0x00000040 /* update fields needed for permission
+ checking */
+#define UP_RENAME 0x00000080 /* this is a rename op - delete the cache
+ entry */
+#define UP_FORGET 0x00000100 /* inode_forget on server side -
+ invalidate the cache entry */
+#define UP_PARENT_TIMES 0x00000200 /* update parent dir times */
+
+#define UP_XATTR 0x00000400 /* update the xattrs and ctime */
+#define UP_XATTR_RM 0x00000800 /* Remove the xattrs and update ctime */
+
+/* for fops - open, read, lk, */
+#define UP_UPDATE_CLIENT (UP_ATIME)
+
+/* for fop - write, truncate */
+#define UP_WRITE_FLAGS (UP_SIZE | UP_TIMES)
+
+/* for fop - setattr */
+#define UP_ATTR_FLAGS (UP_SIZE | UP_TIMES | UP_OWN | UP_MODE | \
+ UP_PERM)
+/* for fop - rename */
+#define UP_RENAME_FLAGS (UP_RENAME)
+
+/* to invalidate parent directory entries for fops -rename, unlink, rmdir,
+ * mkdir, create */
+#define UP_PARENT_DENTRY_FLAGS (UP_PARENT_TIMES)
+
+/* for fop - unlink, link, rmdir, mkdir */
+#define UP_NLINK_FLAGS (UP_NLINK | UP_TIMES)
+
+#define IATT_UPDATE_FLAGS (UP_NLINK | UP_MODE | UP_OWN | UP_SIZE | \
+ UP_TIMES | UP_ATIME)
+
typedef enum {
GF_UPCALL_EVENT_NULL,
GF_UPCALL_CACHE_INVALIDATION,