summaryrefslogtreecommitdiffstats
path: root/xlators/features/read-only/src/worm-helper.h
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/read-only/src/worm-helper.h')
-rw-r--r--xlators/features/read-only/src/worm-helper.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/xlators/features/read-only/src/worm-helper.h b/xlators/features/read-only/src/worm-helper.h
new file mode 100644
index 0000000..a06a1d3
--- /dev/null
+++ b/xlators/features/read-only/src/worm-helper.h
@@ -0,0 +1,36 @@
+/*
+ Copyright (c) 2016 Red Hat, Inc. <http://www.redhat.com>
+ This file is part of GlusterFS.
+
+ This file is licensed to you under your choice of the GNU Lesser
+ General Public License, version 3 or any later version (LGPLv3 or
+ later), or the GNU General Public License, version 2 (GPLv2), in all
+ cases as published by the Free Software Foundation.
+*/
+
+gf_boolean_t is_write_disabled (struct iatt *stbuf);
+
+int32_t worm_init_state (xlator_t *this, gf_boolean_t fop_with_fd,
+ void *file_ptr);
+
+int32_t worm_set_state (xlator_t *this, gf_boolean_t fop_with_fd,
+ void *file_ptr, worm_reten_state_t *retention_state,
+ struct iatt *stbuf);
+
+int32_t worm_get_state (xlator_t *this, gf_boolean_t fop_with_fd,
+ void *file_ptr, worm_reten_state_t *reten_state);
+
+void state_lookup (xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr,
+ worm_reten_state_t *reten_state);
+
+void serialize_state (worm_reten_state_t *reten_state, char *val);
+
+void deserialize_state (char *val, worm_reten_state_t *reten_state);
+
+int32_t set_xattr (xlator_t *this, worm_reten_state_t *reten_state,
+ gf_boolean_t fop_with_fd, void *file_ptr);
+
+int32_t state_transition (xlator_t *this, gf_boolean_t fop_with_fd,
+ void *file_ptr, glusterfs_fop_t op, int *ret_val);
+
+int32_t is_wormfile (xlator_t *this, gf_boolean_t fop_with_fd, void *file_ptr);