From da48a6a596251c19a8ddb1bdfec3da9744a78b8f Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 9 Apr 2015 15:38:47 +0530 Subject: features/bit-rot-stub: versioning of objects in write/truncate fop instead of open * This patch brings in the changes where object versioning is done in write and truncate fops instead of tracking them in open and create fops. This model works for both regular and anonymous fds. It also removes the race associated with open calls, create and lookups. This patch follows the below method for object versioning and notifications: Before sending writev on the fd, increase the ongoing version first. This makes anonymous fd write similar to the regular fd write by having the ongoing version increased before doing the write. Do following steps to do versioning: 1) For anonymous fds set the fd context (so that release is invoked) and add the fd context to the list maintained in the inode context. For regular fds the above think would have been done in open itself. 2) Increase the on-disk ongoing version 3) Increase the in memory ongoing version and mark inode as non-dirty 3) Once versioning is successfully done send write operation. If versioning fails, then fail the write fop. 5) In writev_cbk mark inode as modified. > Change-Id: I7104391bbe076d8fc49b68745d2ec29a6e92476c > BUG: 1207979 > Signed-off-by: Raghavendra Bhat > Reviewed-on: http://review.gluster.org/10233 > Tested-by: Gluster Build System > Reviewed-by: Vijay Bellur Change-Id: I4bb86989b5fab02b9ed2950798b1a80e566f1024 BUG: 1220041 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.org/10722 Reviewed-by: Gaurav Kumar Garg Tested-by: NetBSD Build System Tested-by: Gluster Build System --- xlators/features/bit-rot/src/bitd/bit-rot.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.h') diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h index d2cf3b07b4d..1705f715f0c 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot.h @@ -157,6 +157,8 @@ struct br_object { be signed */ br_child_t *child; /* object's subvolume */ + int sign_info; + struct list_head list; /* hook to add to the queue once the object is expired from timer wheel */ void *data; @@ -180,4 +182,8 @@ br_prepare_loc (xlator_t *, br_child_t *, loc_t *, gf_dirent_t *, loc_t *); gf_boolean_t bitd_is_bad_file (xlator_t *, br_child_t *, loc_t *, fd_t *); +void +br_trigger_sign (xlator_t *this, br_child_t *child, inode_t *linked_inode, + loc_t *loc, dict_t *xdata); + #endif /* __BIT_ROT_H__ */ -- cgit