From 8f2fc6fb3a63ca87d82b6fa933f94fb1e3283a26 Mon Sep 17 00:00:00 2001 From: Ajeet Jha Date: Mon, 2 Dec 2013 13:04:51 +0530 Subject: features/changelog: more changelog fixes. -> log additional records. -> include FOP number for metadata. -> prevent crash if inode is not found in a fop. Change-Id: I9edd4b71819ebd68c6a2b4150ae279c471d129da BUG: 1036536 Signed-off-by: Ajeet Jha Reviewed-on: http://review.gluster.org/6403 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Venky Shankar --- xlators/features/changelog/src/changelog-helpers.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'xlators/features/changelog/src/changelog-helpers.h') diff --git a/xlators/features/changelog/src/changelog-helpers.h b/xlators/features/changelog/src/changelog-helpers.h index ad79636b0eb..16d60b99bf2 100644 --- a/xlators/features/changelog/src/changelog-helpers.h +++ b/xlators/features/changelog/src/changelog-helpers.h @@ -225,6 +225,7 @@ typedef struct changelog_inode_ctx { typedef enum { CHANGELOG_OPT_REC_FOP, CHANGELOG_OPT_REC_ENTRY, + CHANGELOG_OPT_REC_UINT32, } changelog_optional_rec_type_t; struct changelog_entry_fields { @@ -253,7 +254,8 @@ typedef struct { size_t co_len; union { - glusterfs_fop_t co_fop; + unsigned int co_uint32; + glusterfs_fop_t co_fop; struct changelog_entry_fields co_entry; }; } changelog_opt_t; @@ -346,6 +348,14 @@ changelog_forget (xlator_t *this, inode_t *inode); } \ } while (0) +#define CHANGELOG_FILL_UINT32(co, number, converter, xlen) do { \ + co->co_convert = converter; \ + co->co_free = NULL; \ + co->co_type = CHANGELOG_OPT_REC_UINT32; \ + co->co_uint32 = number; \ + xlen += sizeof (unsigned int); \ + } while (0) + #define CHANGLOG_FILL_FOP_NUMBER(co, fop, converter, xlen) do { \ co->co_convert = converter; \ co->co_free = NULL; \ -- cgit