diff options
author | Venky Shankar <vshankar@redhat.com> | 2015-05-26 21:51:31 +0530 |
---|---|---|
committer | Vijay Bellur <vbellur@redhat.com> | 2015-05-28 02:39:05 -0700 |
commit | e9290dc0db7bee31cda1cbed1d9eb68d9c404746 (patch) | |
tree | a52ecd5ced83ebc6f0d4e62cb6fc72e20c86efba /xlators/features/bit-rot/src/stub/bit-rot-common.h | |
parent | bc858473db1e1091b15d3f3d69ac6ba5d20b58e7 (diff) |
features/bitrot: stub improvements and fixes
This patch refactors the signing trigger mechanism used by bitrot
daemon as a "catch up" meachanism to sign files which _missed_
signing on the last run either due to bitrot being disabled and
enabled again or if bitrot is enabled for a volume with existing
data.
Existing implementation relies on overloading writev() to trigger
signing which just by the looks sounded dangerous and I hated it
to the core. This change moves all that business to the setxattr
interface thereby keeping the writev path strictly for client
IO.
Why not use IPC fop to trigger signing?
There's a need to access the object's inode to perform various
maintainance operations. inode is not _directly_ accessible in
the IPC fop (although, it can be found via inode_grep() for the
object's GFID - the inode just needs to be pinned in memory,
which is the case if there's an active fd on the inode). This
patch relies on good old technique of overloading fsetxattr()
to do the job instead of using IPC fop.
There are some pretty nice cleanups along the lines of memory
deallocations, unncessary allocations and redundant ref()ing
of structures (such as fd's) provided by this patch. All in
all - much improved code navigation.
Change-Id: Id93fe90b1618802d1a95a5072517dac342b96cb8
BUG: 1224600
Signed-off-by: Venky Shankar <vshankar@redhat.com>
Reviewed-on: http://review.gluster.org/10942
Tested-by: NetBSD Build System
Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/stub/bit-rot-common.h')
-rw-r--r-- | xlators/features/bit-rot/src/stub/bit-rot-common.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xlators/features/bit-rot/src/stub/bit-rot-common.h b/xlators/features/bit-rot/src/stub/bit-rot-common.h index 7fd584e5970..a8285d2b560 100644 --- a/xlators/features/bit-rot/src/stub/bit-rot-common.h +++ b/xlators/features/bit-rot/src/stub/bit-rot-common.h @@ -119,6 +119,11 @@ typedef enum { /* BitRot stub start time (virtual xattr) */ #define GLUSTERFS_GET_BR_STUB_INIT_TIME "trusted.glusterfs.bit-rot.stub-init" +/* signing/reopen hint */ +#define BR_OBJECT_RESIGN 0 +#define BR_OBJECT_REOPEN 1 +#define BR_REOPEN_SIGN_HINT_KEY "trusted.glusterfs.bit-rot.reopen-hint" + static inline int br_is_signature_type_valid (int8_t signaturetype) { |