summaryrefslogtreecommitdiffstats
path: root/xlators/features/trash/src/trash.h
diff options
context:
space:
mode:
authorAnoop C S <achiraya@redhat.com>2015-02-27 15:14:08 +0530
committerVijay Bellur <vbellur@redhat.com>2015-03-16 03:36:37 -0700
commit0ef870741a2f49d47a02725aed13a95335a6e42f (patch)
treefa7e63dae2c23674d61172650a6785b8502d59b8 /xlators/features/trash/src/trash.h
parent393cdb2613250031fce92cab8dede9154514f816 (diff)
Features/trash : Combined patches for trash translator
This is the combined patch set for supporting trash feature. http://www.gluster.org/community/documentation/index.php/Features/Trash Current patch includes the following features: * volume set options for enabling trash globally and exclusively for internal operations like self-heal and re-balance * volume set options for setting the eliminate path, trash directory path and maximum trashable file size. * test script for checking the functionality of the feature * brief documentation on different aspects of trash feature. Change-Id: Ic7486982dcd6e295d1eba0f4d5ee6d33bf1b4cb3 BUG: 1132465 Signed-off-by: Anoop C S <achiraya@redhat.com> Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com> Reviewed-on: http://review.gluster.org/8312 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/trash/src/trash.h')
-rw-r--r--xlators/features/trash/src/trash.h36
1 files changed, 20 insertions, 16 deletions
diff --git a/xlators/features/trash/src/trash.h b/xlators/features/trash/src/trash.h
index 9a7c033617d..3e03edf5474 100644
--- a/xlators/features/trash/src/trash.h
+++ b/xlators/features/trash/src/trash.h
@@ -37,7 +37,6 @@
#define GF_ALLOWED_MAX_FILE_SIZE (1 * GF_UNIT_GB)
#endif
-
struct trash_struct {
fd_t *fd; /* for the fd of existing file */
fd_t *newfd; /* for the newly created file */
@@ -54,26 +53,31 @@ struct trash_struct {
};
typedef struct trash_struct trash_local_t;
-struct _trash_elim_pattern;
-typedef struct _trash_elim_pattern {
- struct _trash_elim_pattern *next;
- char *pattern;
-} trash_elim_pattern_t;
+struct _trash_elim_path {
+ struct _trash_elim_path *next;
+ char *path;
+};
+typedef struct _trash_elim_path trash_elim_path;
struct trash_priv {
- char *trash_dir;
- trash_elim_pattern_t *eliminate;
+ char *oldtrash_dir;
+ char *newtrash_dir;
+ char *brick_path;
+ trash_elim_path *eliminate;
size_t max_trash_file_size;
+ gf_boolean_t state;
+ gf_boolean_t internal;
+ inode_t *trash_inode;
+ inode_table_t *trash_itable;
};
typedef struct trash_priv trash_private_t;
-#define TRASH_STACK_UNWIND(op, frame, params ...) do { \
- trash_local_t *__local = NULL; \
- __local = frame->local; \
- frame->local = NULL; \
- STACK_UNWIND_STRICT (op, frame, params); \
- trash_local_wipe (__local); \
- } while (0)
-
+#define TRASH_STACK_UNWIND(op, frame, params ...) do { \
+ trash_local_t *__local = NULL; \
+ __local = frame->local; \
+ frame->local = NULL; \
+ STACK_UNWIND_STRICT (op, frame, params); \
+ trash_local_wipe (__local); \
+ } while (0)
#endif /* __TRASH_H__ */