From fd2e7d007e5362f0738cd9a825349abcf5d27d8f Mon Sep 17 00:00:00 2001 From: Pavan Sondur Date: Fri, 1 Oct 2010 05:45:12 +0000 Subject: Changes to replace flock with gf_flock across GlusterFS. Signed-off-by: Pavan Vilas Sondur Signed-off-by: Vijay Bellur BUG: 865 (Add locks recovery support in GlusterFS) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=865 --- xlators/cluster/afr/src/afr-common.c | 10 ++++----- xlators/cluster/afr/src/afr-lk-common.c | 26 +++++++++++----------- xlators/cluster/afr/src/afr.h | 6 ++--- xlators/cluster/dht/src/dht-common.c | 8 +++---- xlators/cluster/ha/src/ha.c | 12 +++++----- xlators/cluster/map/src/map.c | 8 +++---- xlators/cluster/stripe/src/stripe.c | 4 ++-- xlators/cluster/stripe/src/stripe.h | 2 +- xlators/cluster/unify/src/unify.c | 8 +++---- xlators/debug/error-gen/src/error-gen.c | 8 +++---- xlators/debug/io-stats/src/io-stats.c | 8 +++---- xlators/debug/trace/src/trace.c | 8 +++---- xlators/features/locks/src/common.c | 14 ++++++------ xlators/features/locks/src/common.h | 12 +++++----- xlators/features/locks/src/inodelk.c | 12 +++++----- xlators/features/locks/src/locks.h | 4 ++-- xlators/features/locks/src/posix.c | 12 +++++----- xlators/features/path-convertor/src/path.c | 2 +- xlators/features/quiesce/src/quiesce.c | 6 ++--- xlators/features/read-only/src/read-only.c | 6 ++--- xlators/meta/src/meta.c | 4 ++-- xlators/mount/fuse/src/fuse-bridge.c | 10 +++++---- xlators/mount/fuse/src/fuse-bridge.h | 2 +- xlators/performance/io-cache/src/io-cache.c | 4 ++-- xlators/performance/io-threads/src/io-threads.c | 6 ++--- xlators/performance/quick-read/src/quick-read.c | 10 ++++----- .../performance/stat-prefetch/src/stat-prefetch.c | 4 ++-- xlators/protocol/client/src/client-lk.c | 24 ++++++++++---------- xlators/protocol/client/src/client.c | 6 ++--- xlators/protocol/client/src/client.h | 6 ++--- xlators/protocol/client/src/client3_1-fops.c | 10 ++++----- .../protocol/legacy/client/src/client-protocol.c | 8 +++---- xlators/protocol/legacy/lib/src/protocol.h | 4 ++-- .../protocol/legacy/server/src/server-helpers.c | 4 ++-- .../protocol/legacy/server/src/server-protocol.c | 2 +- .../protocol/legacy/server/src/server-protocol.h | 2 +- xlators/protocol/server/src/server-helpers.c | 4 ++-- xlators/protocol/server/src/server.h | 2 +- xlators/protocol/server/src/server3_1-fops.c | 10 ++++----- xlators/storage/bdb/src/bdb.c | 8 +++---- xlators/storage/posix/src/posix.c | 8 +++---- 41 files changed, 158 insertions(+), 156 deletions(-) (limited to 'xlators') diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index e5a7e87c72f..ee5fa3a606e 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -1871,7 +1871,7 @@ afr_inodelk_cbk (call_frame_t *frame, void *cookie, int32_t afr_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *flock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock) { afr_private_t *priv = NULL; afr_local_t *local = NULL; @@ -1953,7 +1953,7 @@ afr_finodelk_cbk (call_frame_t *frame, void *cookie, int32_t afr_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *flock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock) { afr_private_t *priv = NULL; afr_local_t *local = NULL; @@ -2264,7 +2264,7 @@ out: int32_t afr_lk_unlock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { afr_local_t * local = NULL; @@ -2325,7 +2325,7 @@ afr_lk_unlock (call_frame_t *frame, xlator_t *this) int32_t afr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { afr_local_t *local = NULL; afr_private_t *priv = NULL; @@ -2391,7 +2391,7 @@ afr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int afr_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *flock) + struct gf_flock *flock) { afr_private_t *priv = NULL; afr_local_t *local = NULL; diff --git a/xlators/cluster/afr/src/afr-lk-common.c b/xlators/cluster/afr/src/afr-lk-common.c index 12050af1d35..06f35597429 100644 --- a/xlators/cluster/afr/src/afr-lk-common.c +++ b/xlators/cluster/afr/src/afr-lk-common.c @@ -120,7 +120,7 @@ internal_lock_count (call_frame_t *frame, xlator_t *this, static void afr_print_inodelk (char *str, int size, int cmd, - struct flock *flock, uint64_t owner) + struct gf_flock *flock, uint64_t owner) { char *cmd_str = NULL; char *type_str = NULL; @@ -247,7 +247,7 @@ afr_set_lock_call_type (afr_lock_call_type_t lock_call_type, static void afr_trace_inodelk_out (call_frame_t *frame, afr_lock_call_type_t lock_call_type, - afr_lock_op_type_t lk_op_type, struct flock *flock, + afr_lock_op_type_t lk_op_type, struct gf_flock *flock, int op_ret, int op_errno, int32_t child_index) { xlator_t *this = NULL; @@ -286,7 +286,7 @@ afr_trace_inodelk_out (call_frame_t *frame, afr_lock_call_type_t lock_call_type, static void afr_trace_inodelk_in (call_frame_t *frame, afr_lock_call_type_t lock_call_type, - afr_lock_op_type_t lk_op_type, struct flock *flock, + afr_lock_op_type_t lk_op_type, struct gf_flock *flock, int32_t cmd, int32_t child_index) { xlator_t *this = NULL; @@ -578,7 +578,7 @@ afr_unlock_inodelk (call_frame_t *frame, xlator_t *this) afr_local_t *local = NULL; afr_private_t *priv = NULL; - struct flock flock; + struct gf_flock flock; int call_count = 0; int i = 0; @@ -908,7 +908,7 @@ afr_lock_blocking (call_frame_t *frame, xlator_t *this, int child_index) const char *lower_name = NULL; const char *higher_name = NULL; - struct flock flock; + struct gf_flock flock; uint64_t ctx; int ret = 0; @@ -1360,7 +1360,7 @@ afr_nonblocking_inodelk (call_frame_t *frame, xlator_t *this) uint64_t ctx = 0; int i = 0; int ret = 0; - struct flock flock; + struct gf_flock flock; local = frame->local; int_lock = &local->internal_lock; @@ -1836,15 +1836,15 @@ out: int32_t afr_get_locks_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock); + int32_t op_ret, int32_t op_errno, struct gf_flock *lock); int32_t afr_recover_lock_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { afr_local_t *local = NULL; afr_private_t *priv = NULL; int32_t source_child = 0; - struct flock flock = {0,}; + struct gf_flock flock = {0,}; if (op_ret) { gf_log (this->name, GF_LOG_DEBUG, @@ -1871,7 +1871,7 @@ cleanup: int afr_recover_lock (call_frame_t *frame, xlator_t *this, - struct flock *flock) + struct gf_flock *flock) { afr_local_t *local = NULL; afr_private_t *priv = NULL; @@ -1892,7 +1892,7 @@ afr_recover_lock (call_frame_t *frame, xlator_t *this, } static int -is_afr_lock_eol (struct flock *lock) +is_afr_lock_eol (struct gf_flock *lock) { int ret = 0; @@ -1904,7 +1904,7 @@ is_afr_lock_eol (struct flock *lock) int32_t afr_get_locks_fd_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { if (op_ret) { gf_log (this->name, GF_LOG_DEBUG, @@ -1939,7 +1939,7 @@ afr_lock_recovery (call_frame_t *frame, xlator_t *this) fd_t *fd = NULL; int ret = 0; int32_t source_child = 0; - struct flock flock = {0,}; + struct gf_flock flock = {0,}; priv = this->private; local = frame->local; diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 005847b412f..ed50fdfbfd2 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -235,7 +235,7 @@ afr_index_for_transaction_type (afr_transaction_type type) typedef struct { loc_t *lk_loc; - struct flock lk_flock; + struct gf_flock lk_flock; const char *lk_basename; const char *lower_basename; @@ -347,8 +347,8 @@ typedef struct _afr_local { struct { int32_t cmd; - struct flock user_flock; - struct flock ret_flock; + struct gf_flock user_flock; + struct gf_flock ret_flock; unsigned char *locked_nodes; } lk; diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 2c8a535477c..0a39084a177 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -2350,7 +2350,7 @@ err: int dht_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int op_ret, int op_errno, struct flock *flock) + int op_ret, int op_errno, struct gf_flock *flock) { DHT_STACK_UNWIND (lk, frame, op_ret, op_errno, flock); @@ -2360,7 +2360,7 @@ dht_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int dht_lk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int cmd, struct flock *flock) + fd_t *fd, int cmd, struct gf_flock *flock) { xlator_t *subvol = NULL; int op_errno = -1; @@ -4287,7 +4287,7 @@ dht_inodelk_cbk (call_frame_t *frame, void *cookie, int32_t dht_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock) { xlator_t *subvol = NULL; int op_errno = -1; @@ -4346,7 +4346,7 @@ dht_finodelk_cbk (call_frame_t *frame, void *cookie, int dht_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock) { xlator_t *subvol = NULL; int op_errno = -1; diff --git a/xlators/cluster/ha/src/ha.c b/xlators/cluster/ha/src/ha.c index 54b41858eee..a8dd5c724d2 100644 --- a/xlators/cluster/ha/src/ha.c +++ b/xlators/cluster/ha/src/ha.c @@ -3066,7 +3066,7 @@ ha_lk_setlk_unlck_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { ha_local_t *local = NULL; int cnt = 0; @@ -3099,7 +3099,7 @@ ha_lk_setlk_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { ha_local_t *local = NULL; ha_private_t *pvt = NULL; @@ -3155,7 +3155,7 @@ ha_lk_setlk_cbk (call_frame_t *frame, cnt++; } if (cnt) { - struct flock lock; + struct gf_flock lock; lock = local->stub->args.lk.lock; for (i = 0; i < child_count; i++) { if (state[i]) { @@ -3189,7 +3189,7 @@ ha_lk_getlk_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { ha_local_t *local = NULL; ha_private_t *pvt = NULL; @@ -3244,7 +3244,7 @@ ha_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { ha_local_t *local = NULL; ha_private_t *pvt = NULL; @@ -3378,7 +3378,7 @@ ha_inodelk (call_frame_t *frame, const char *volume, loc_t *loc, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { ha_local_t *local = NULL; int op_errno = 0; diff --git a/xlators/cluster/map/src/map.c b/xlators/cluster/map/src/map.c index dd89d0ebee9..df650db86d5 100644 --- a/xlators/cluster/map/src/map.c +++ b/xlators/cluster/map/src/map.c @@ -438,7 +438,7 @@ map_lk_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { STACK_UNWIND (frame, op_ret, op_errno, lock); return 0; @@ -1770,7 +1770,7 @@ map_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { int32_t op_errno = 1; xlator_t *subvol = NULL; @@ -1799,7 +1799,7 @@ map_lk (call_frame_t *frame, int32_t map_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock) { int32_t op_errno = 1; xlator_t *subvol = NULL; @@ -1829,7 +1829,7 @@ map_inodelk (call_frame_t *frame, xlator_t *this, int32_t map_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock) { int32_t op_errno = 1; xlator_t *subvol = NULL; diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 00c888f68dd..72c7b4515e2 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -2566,7 +2566,7 @@ err: int32_t stripe_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { int32_t callcnt = 0; stripe_local_t *local = NULL; @@ -2614,7 +2614,7 @@ out: int32_t stripe_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { stripe_local_t *local = NULL; xlator_list_t *trav = NULL; diff --git a/xlators/cluster/stripe/src/stripe.h b/xlators/cluster/stripe/src/stripe.h index 8afc6aa9a58..a17912908ad 100644 --- a/xlators/cluster/stripe/src/stripe.h +++ b/xlators/cluster/stripe/src/stripe.h @@ -147,7 +147,7 @@ struct stripe_local { int entry_self_heal_needed; int8_t *list; - struct flock lock; + struct gf_flock lock; fd_t *fd; void *value; struct iobref *iobref; diff --git a/xlators/cluster/unify/src/unify.c b/xlators/cluster/unify/src/unify.c index e50d3274f3b..c307de6f4f0 100644 --- a/xlators/cluster/unify/src/unify.c +++ b/xlators/cluster/unify/src/unify.c @@ -2644,7 +2644,7 @@ unify_lk_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { STACK_UNWIND (frame, op_ret, op_errno, lock); return 0; @@ -2658,7 +2658,7 @@ unify_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { UNIFY_CHECK_FD_CTX_AND_UNWIND_ON_ERR (fd); xlator_t *child = NULL; @@ -3999,7 +3999,7 @@ unify_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int unify_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int cmd, struct flock *flock) + const char *volume, fd_t *fd, int cmd, struct gf_flock *flock) { UNIFY_CHECK_FD_CTX_AND_UNWIND_ON_ERR (fd); xlator_t *child = NULL; @@ -4103,7 +4103,7 @@ unify_inodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, */ int unify_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int cmd, struct flock *flock) + const char *volume, loc_t *loc, int cmd, struct gf_flock *flock) { xlator_t *child = NULL; diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c index 095b077b48e..b9ed44b2101 100644 --- a/xlators/debug/error-gen/src/error-gen.c +++ b/xlators/debug/error-gen/src/error-gen.c @@ -1526,7 +1526,7 @@ error_gen_removexattr (call_frame_t *frame, xlator_t *this, loc_t *loc, int error_gen_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock); return 0; @@ -1535,7 +1535,7 @@ error_gen_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int error_gen_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { int op_errno = 0; eg_t *egp = NULL; @@ -1574,7 +1574,7 @@ error_gen_inodelk_cbk (call_frame_t *frame, void *cookie, int error_gen_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { int op_errno = 0; eg_t *egp = NULL; @@ -1613,7 +1613,7 @@ error_gen_finodelk_cbk (call_frame_t *frame, void *cookie, int error_gen_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { int op_errno = 0; eg_t *egp = NULL; diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index dcdd4264530..4a96ca3c240 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -797,7 +797,7 @@ io_stats_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { END_FOP_LATENCY (frame, LK); STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock); @@ -864,7 +864,7 @@ io_stats_entrylk (call_frame_t *frame, xlator_t *this, int io_stats_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *flock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock) { BUMP_FOP (INODELK); @@ -892,7 +892,7 @@ io_stats_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int io_stats_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *flock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock) { BUMP_FOP (FINODELK); @@ -1489,7 +1489,7 @@ io_stats_fstat (call_frame_t *frame, xlator_t *this, int io_stats_lk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int32_t cmd, struct flock *lock) + fd_t *fd, int32_t cmd, struct gf_flock *lock) { BUMP_FOP (LK); diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index f5af77681a9..43e9c7a7a90 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -1121,7 +1121,7 @@ trace_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int trace_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { if (trace_fop_names[GF_FOP_LK].enabled) { if (op_ret >= 0) { @@ -1226,7 +1226,7 @@ trace_entrylk (call_frame_t *frame, xlator_t *this, int trace_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, - loc_t *loc, int32_t cmd, struct flock *flock) + loc_t *loc, int32_t cmd, struct gf_flock *flock) { if (trace_fop_names[GF_FOP_INODELK].enabled) { gf_log (this->name, GF_LOG_NORMAL, @@ -1260,7 +1260,7 @@ trace_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int trace_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, - fd_t *fd, int32_t cmd, struct flock *flock) + fd_t *fd, int32_t cmd, struct gf_flock *flock) { if (trace_fop_names[GF_FOP_FINODELK].enabled) { gf_log (this->name, GF_LOG_NORMAL, @@ -1938,7 +1938,7 @@ trace_fstat (call_frame_t *frame, xlator_t *this, fd_t *fd) int trace_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, - int32_t cmd, struct flock *lock) + int32_t cmd, struct gf_flock *lock) { if (trace_fop_names[GF_FOP_LK].enabled) { gf_log (this->name, GF_LOG_NORMAL, diff --git a/xlators/features/locks/src/common.c b/xlators/features/locks/src/common.c index 9f2d11304df..0df5fcae5b8 100644 --- a/xlators/features/locks/src/common.c +++ b/xlators/features/locks/src/common.c @@ -176,7 +176,7 @@ pl_print_lockee (char *str, int size, fd_t *fd, loc_t *loc) void pl_print_lock (char *str, int size, int cmd, - struct flock *flock, uint64_t owner) + struct gf_flock *flock, uint64_t owner) { char *cmd_str = NULL; char *type_str = NULL; @@ -234,7 +234,7 @@ pl_print_lock (char *str, int size, int cmd, void pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, - int cmd, struct flock *flock, const char *domain) + int cmd, struct gf_flock *flock, const char *domain) { posix_locks_private_t *priv = NULL; char pl_locker[256]; @@ -282,7 +282,7 @@ pl_print_verdict (char *str, int size, int op_ret, int op_errno) void pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, - int cmd, struct flock *flock, int op_ret, int op_errno, const char *domain) + int cmd, struct gf_flock *flock, int op_ret, int op_errno, const char *domain) { posix_locks_private_t *priv = NULL; @@ -313,7 +313,7 @@ pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, void pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, - int cmd, struct flock *flock, const char *domain) + int cmd, struct gf_flock *flock, const char *domain) { posix_locks_private_t *priv = NULL; @@ -460,7 +460,7 @@ out: /* Create a new posix_lock_t */ posix_lock_t * -new_posix_lock (struct flock *flock, void *transport, pid_t client_pid, +new_posix_lock (struct gf_flock *flock, void *transport, pid_t client_pid, uint64_t owner, fd_t *fd) { posix_lock_t *lock = NULL; @@ -506,9 +506,9 @@ __destroy_lock (posix_lock_t *lock) } -/* Convert a posix_lock to a struct flock */ +/* Convert a posix_lock to a struct gf_flock */ void -posix_lock_to_flock (posix_lock_t *lock, struct flock *flock) +posix_lock_to_flock (posix_lock_t *lock, struct gf_flock *flock) { flock->l_pid = lock->client_pid; flock->l_type = lock->fl_type; diff --git a/xlators/features/locks/src/common.h b/xlators/features/locks/src/common.h index c7d817f8da0..72b113310b7 100644 --- a/xlators/features/locks/src/common.h +++ b/xlators/features/locks/src/common.h @@ -21,7 +21,7 @@ #define __COMMON_H__ posix_lock_t * -new_posix_lock (struct flock *flock, void *transport, pid_t client_pid, +new_posix_lock (struct gf_flock *flock, void *transport, pid_t client_pid, uint64_t owner, fd_t *fd); pl_inode_t * @@ -38,7 +38,7 @@ void grant_blocked_locks (xlator_t *this, pl_inode_t *inode); void -posix_lock_to_flock (posix_lock_t *lock, struct flock *flock); +posix_lock_to_flock (posix_lock_t *lock, struct gf_flock *flock); int locks_overlap (posix_lock_t *l1, posix_lock_t *l2); @@ -75,13 +75,13 @@ int32_t get_entrylk_count (xlator_t *this, inode_t *inode); void pl_trace_in (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, - int cmd, struct flock *flock, const char *domain); + int cmd, struct gf_flock *flock, const char *domain); void pl_trace_out (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, - int cmd, struct flock *flock, int op_ret, int op_errno, const char *domain); + int cmd, struct gf_flock *flock, int op_ret, int op_errno, const char *domain); void pl_trace_block (xlator_t *this, call_frame_t *frame, fd_t *fd, loc_t *loc, - int cmd, struct flock *flock, const char *domain); + int cmd, struct gf_flock *flock, const char *domain); void pl_trace_flush (xlator_t *this, call_frame_t *frame, fd_t *fd); @@ -108,7 +108,7 @@ void pl_print_locker (char *str, int size, xlator_t *this, call_frame_t *frame); void -pl_print_inodelk (char *str, int size, int cmd, struct flock *flock, const char *domain); +pl_print_inodelk (char *str, int size, int cmd, struct gf_flock *flock, const char *domain); void pl_trace_release (xlator_t *this, fd_t *fd); diff --git a/xlators/features/locks/src/inodelk.c b/xlators/features/locks/src/inodelk.c index eaae8d4deed..f0985c8ceca 100644 --- a/xlators/features/locks/src/inodelk.c +++ b/xlators/features/locks/src/inodelk.c @@ -56,7 +56,7 @@ inodelk_type_conflict (pl_inode_lock_t *l1, pl_inode_lock_t *l2) } void -pl_print_inodelk (char *str, int size, int cmd, struct flock *flock, const char *domain) +pl_print_inodelk (char *str, int size, int cmd, struct gf_flock *flock, const char *domain) { char *cmd_str = NULL; char *type_str = NULL; @@ -505,7 +505,7 @@ out: /* Create a new inode_lock_t */ pl_inode_lock_t * -new_inode_lock (struct flock *flock, void *transport, pid_t client_pid, +new_inode_lock (struct gf_flock *flock, void *transport, pid_t client_pid, uint64_t owner, const char *volume) { @@ -540,7 +540,7 @@ new_inode_lock (struct flock *flock, void *transport, pid_t client_pid, int pl_common_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, inode_t *inode, int32_t cmd, - struct flock *flock, loc_t *loc, fd_t *fd) + struct gf_flock *flock, loc_t *loc, fd_t *fd) { int32_t op_ret = -1; int32_t op_errno = 0; @@ -612,7 +612,7 @@ pl_common_inodelk (call_frame_t *frame, xlator_t *this, /* fall through */ case F_SETLK: - memcpy (&reqlock->user_flock, flock, sizeof (struct flock)); + memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock)); ret = pl_inode_setlk (this, pinode, reqlock, can_block, dom); @@ -653,7 +653,7 @@ out: int pl_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *flock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock) { pl_common_inodelk (frame, this, volume, loc->inode, cmd, flock, loc, NULL); @@ -663,7 +663,7 @@ pl_inodelk (call_frame_t *frame, xlator_t *this, int pl_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *flock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock) { pl_common_inodelk (frame, this, volume, fd->inode, cmd, flock, NULL, fd); diff --git a/xlators/features/locks/src/locks.h b/xlators/features/locks/src/locks.h index 483e3e6669e..83683c3523c 100644 --- a/xlators/features/locks/src/locks.h +++ b/xlators/features/locks/src/locks.h @@ -40,7 +40,7 @@ struct __posix_lock { off_t fl_end; short blocked; /* waiting to acquire */ - struct flock user_flock; /* the flock supplied by the user */ + struct gf_flock user_flock; /* the flock supplied by the user */ xlator_t *this; /* required for blocked locks */ unsigned long fd_num; @@ -65,7 +65,7 @@ struct __pl_inode_lock { const char *volume; - struct flock user_flock; /* the flock supplied by the user */ + struct gf_flock user_flock; /* the flock supplied by the user */ xlator_t *this; /* required for blocked locks */ fd_t *fd; diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 7c8ead8b383..1b3a1a60499 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -932,7 +932,7 @@ unlock: int pl_lk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int32_t cmd, struct flock *flock) + fd_t *fd, int32_t cmd, struct gf_flock *flock) { void *transport = NULL; pid_t client_pid = 0; @@ -984,7 +984,7 @@ pl_lk (call_frame_t *frame, xlator_t *this, /* fall through */ case F_RESLK_LCK: - memcpy (&reqlock->user_flock, flock, sizeof (struct flock)); + memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock)); reqlock->frame = frame; reqlock->this = this; @@ -1065,7 +1065,7 @@ pl_lk (call_frame_t *frame, xlator_t *this, case F_SETLK64: #endif case F_SETLK: - memcpy (&reqlock->user_flock, flock, sizeof (struct flock)); + memcpy (&reqlock->user_flock, flock, sizeof (struct gf_flock)); ret = pl_verify_reservelk (this, pl_inode, reqlock, can_block); if (ret < 0) { gf_log (this->name, GF_LOG_TRACE, @@ -1439,7 +1439,7 @@ out: } void -pl_dump_lock (char *str, int size, struct flock *flock, +pl_dump_lock (char *str, int size, struct gf_flock *flock, uint64_t owner, void *trans) { char *type_str = NULL; @@ -1794,11 +1794,11 @@ fini (xlator_t *this) int pl_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *flock); + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *flock); int pl_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *flock); + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *flock); int pl_entrylk (call_frame_t *frame, xlator_t *this, diff --git a/xlators/features/path-convertor/src/path.c b/xlators/features/path-convertor/src/path.c index 0a86baa8785..bf871c1fe2b 100644 --- a/xlators/features/path-convertor/src/path.c +++ b/xlators/features/path-convertor/src/path.c @@ -1057,7 +1057,7 @@ path_entrylk (call_frame_t *frame, xlator_t *this, int32_t path_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock) { char *loc_path = (char *)loc->path; char *tmp_path = NULL; diff --git a/xlators/features/quiesce/src/quiesce.c b/xlators/features/quiesce/src/quiesce.c index 8d062cb5105..168e32373d5 100644 --- a/xlators/features/quiesce/src/quiesce.c +++ b/xlators/features/quiesce/src/quiesce.c @@ -987,7 +987,7 @@ quiesce_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -1020,7 +1020,7 @@ quiesce_lk (call_frame_t *frame, int32_t quiesce_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; @@ -1050,7 +1050,7 @@ quiesce_inodelk (call_frame_t *frame, xlator_t *this, int32_t quiesce_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock) { quiesce_priv_t *priv = NULL; call_stub_t *stub = NULL; diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c index 49c2ce58dd1..8c71f0a0d78 100644 --- a/xlators/features/read-only/src/read-only.c +++ b/xlators/features/read-only/src/read-only.c @@ -60,7 +60,7 @@ ro_fentrylk (call_frame_t *frame, xlator_t *this, const char *volume, int32_t ro_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, - loc_t *loc, int32_t cmd, struct flock *lock) + loc_t *loc, int32_t cmd, struct gf_flock *lock) { STACK_UNWIND_STRICT (inodelk, frame, -1, EROFS); return 0; @@ -68,7 +68,7 @@ ro_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, int32_t ro_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, - fd_t *fd, int32_t cmd, struct flock *lock) + fd_t *fd, int32_t cmd, struct gf_flock *lock) { STACK_UNWIND_STRICT (finodelk, frame, -1, EROFS); return 0; @@ -76,7 +76,7 @@ ro_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, int32_t ro_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int cmd, - struct flock *flock) + struct gf_flock *flock) { STACK_UNWIND_STRICT (lk, frame, -1, EROFS, NULL); return 0; diff --git a/xlators/meta/src/meta.c b/xlators/meta/src/meta.c index face2fe70f1..19e422785b1 100644 --- a/xlators/meta/src/meta.c +++ b/xlators/meta/src/meta.c @@ -1136,7 +1136,7 @@ meta_lk_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { STACK_UNWIND (frame, op_ret, @@ -1150,7 +1150,7 @@ meta_lk (call_frame_t *frame, xlator_t *this, dict_t *file, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { STACK_WIND (frame, meta_lk_cbk, diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 5d5eb63c74f..b6497b15efd 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -2645,7 +2645,7 @@ static int gf_fuse_lk_enosys_log; static int fuse_getlk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { fuse_state_t *state = NULL; @@ -2710,7 +2710,8 @@ fuse_getlk (xlator_t *this, fuse_in_header_t *finh, void *msg) fd = FH_TO_FD (fli->fh); GET_STATE (this, finh, state); state->fd = fd; - convert_fuse_file_lock (&fli->lk, &state->lk_lock); + convert_fuse_file_lock (&fli->lk, &state->lk_lock, + fli->owner); state->lk_owner = fli->owner; @@ -2722,7 +2723,7 @@ fuse_getlk (xlator_t *this, fuse_in_header_t *finh, void *msg) static int fuse_setlk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { fuse_state_t *state = NULL; @@ -2790,7 +2791,8 @@ fuse_setlk (xlator_t *this, fuse_in_header_t *finh, void *msg) GET_STATE (this, finh, state); state->finh = finh; state->fd = fd; - convert_fuse_file_lock (&fli->lk, &state->lk_lock); + convert_fuse_file_lock (&fli->lk, &state->lk_lock, + fli->owner); state->lk_owner = fli->owner; diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h index 53a2cc59814..d719832e398 100644 --- a/xlators/mount/fuse/src/fuse-bridge.h +++ b/xlators/mount/fuse/src/fuse-bridge.h @@ -265,7 +265,7 @@ typedef struct { dev_t rdev; mode_t mode; struct iatt attr; - struct flock lk_lock; + struct gf_flock lk_lock; struct iovec vector; uuid_t gfid; diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 7de7640de64..f64d06816bd 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -1323,7 +1323,7 @@ ioc_ftruncate (call_frame_t *frame, xlator_t *this, fd_t *fd, off_t offset) int32_t ioc_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct flock *lock) + int32_t op_errno, struct gf_flock *lock) { STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, lock); return 0; @@ -1331,7 +1331,7 @@ ioc_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t ioc_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { ioc_inode_t *ioc_inode = NULL; uint64_t tmp_inode = 0; diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 72fbd567fcd..3d072d20fca 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -1000,7 +1000,7 @@ out: int32_t iot_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *flock) + int32_t op_ret, int32_t op_errno, struct gf_flock *flock) { STACK_UNWIND_STRICT (lk, frame, op_ret, op_errno, flock); return 0; @@ -1009,7 +1009,7 @@ iot_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int iot_lk_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd, - int32_t cmd, struct flock *flock) + int32_t cmd, struct gf_flock *flock) { STACK_WIND (frame, iot_lk_cbk, FIRST_CHILD(this), @@ -1021,7 +1021,7 @@ iot_lk_wrapper (call_frame_t *frame, xlator_t *this, fd_t *fd, int iot_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *flock) + struct gf_flock *flock) { call_stub_t *stub = NULL; int ret = -1; diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 5813d961c49..b5991fcde6f 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -1856,7 +1856,7 @@ qr_finodelk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t qr_finodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume, - fd_t *fd, int32_t cmd, struct flock *lock) + fd_t *fd, int32_t cmd, struct gf_flock *lock) { STACK_WIND (frame, qr_finodelk_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->finodelk, volume, fd, cmd, lock); @@ -1866,7 +1866,7 @@ qr_finodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume, int32_t qr_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, fd_t *fd, - int32_t cmd, struct flock *lock) + int32_t cmd, struct gf_flock *lock) { int flags = 0; uint64_t value = 0; @@ -2193,7 +2193,7 @@ out: int32_t qr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, - int32_t op_errno, struct flock *lock) + int32_t op_errno, struct gf_flock *lock) { QR_STACK_UNWIND (lk, frame, op_ret, op_errno, lock); return 0; @@ -2202,7 +2202,7 @@ qr_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int32_t op_ret, int32_t qr_lk_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { STACK_WIND (frame, qr_lk_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->lk, fd, cmd, lock); @@ -2213,7 +2213,7 @@ qr_lk_helper (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, int32_t qr_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { int flags = 0; uint64_t value = 0; diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 20301cffd07..76ae9d20980 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -3381,7 +3381,7 @@ out: int32_t sp_inodelk_helper (call_frame_t *frame, xlator_t *this, const char *volume, - loc_t *loc, int32_t cmd, struct flock *lock) + loc_t *loc, int32_t cmd, struct gf_flock *lock) { uint64_t value = 0; sp_inode_ctx_t *inode_ctx = NULL; @@ -3423,7 +3423,7 @@ unwind: int32_t sp_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, loc_t *loc, - int32_t cmd, struct flock *lock) + int32_t cmd, struct gf_flock *lock) { int32_t op_errno = -1; call_stub_t *stub = NULL; diff --git a/xlators/protocol/client/src/client-lk.c b/xlators/protocol/client/src/client-lk.c index 37cae88b7d2..c5696500c5e 100644 --- a/xlators/protocol/client/src/client-lk.c +++ b/xlators/protocol/client/src/client-lk.c @@ -479,7 +479,7 @@ client_cmd_to_gf_cmd (int32_t cmd, int32_t *gf_cmd) } static client_posix_lock_t * -new_client_lock (struct flock *flock, uint64_t owner, +new_client_lock (struct gf_flock *flock, uint64_t owner, int32_t cmd, fd_t *fd) { client_posix_lock_t *new_lock = NULL; @@ -497,7 +497,7 @@ new_client_lock (struct flock *flock, uint64_t owner, INIT_LIST_HEAD (&new_lock->list); new_lock->fd = fd; - memcpy (&new_lock->user_flock, flock, sizeof (struct flock)); + memcpy (&new_lock->user_flock, flock, sizeof (struct gf_flock)); new_lock->fl_type = flock->l_type; new_lock->fl_start = flock->l_start; @@ -526,7 +526,7 @@ client_save_number_fds (clnt_conf_t *conf, int count) } int -client_add_lock_for_recovery (fd_t *fd, struct flock *flock, uint64_t owner, +client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock, uint64_t owner, int32_t cmd) { clnt_fd_ctx_t *fdctx = NULL; @@ -568,7 +568,7 @@ out: } static int -construct_reserve_unlock (struct flock *lock, call_frame_t *frame, +construct_reserve_unlock (struct gf_flock *lock, call_frame_t *frame, client_posix_lock_t *client_lock) { GF_ASSERT (lock); @@ -588,11 +588,11 @@ construct_reserve_unlock (struct flock *lock, call_frame_t *frame, static int construct_reserve_lock (client_posix_lock_t *client_lock, call_frame_t *frame, - struct flock *lock) + struct gf_flock *lock) { GF_ASSERT (client_lock); - memcpy (lock, &(client_lock->user_flock), sizeof (struct flock)); + memcpy (lock, &(client_lock->user_flock), sizeof (struct gf_flock)); frame->root->lk_owner = client_lock->owner; @@ -625,7 +625,7 @@ client_remove_reserve_lock_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { clnt_local_t *local = NULL; clnt_conf_t *conf = NULL; @@ -665,7 +665,7 @@ static void client_remove_reserve_lock (xlator_t *this, call_frame_t *frame, client_posix_lock_t *lock) { - struct flock unlock; + struct gf_flock unlock; clnt_local_t *local = NULL; local = frame->local; @@ -705,7 +705,7 @@ client_reserve_lock_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { clnt_local_t *local = NULL; @@ -761,14 +761,14 @@ client_recovery_lock_cbk (call_frame_t *frame, xlator_t *this, int32_t op_ret, int32_t op_errno, - struct flock *lock) + struct gf_flock *lock) { clnt_local_t *local = NULL; clnt_fd_ctx_t *fdctx = NULL; clnt_conf_t *conf = NULL; client_posix_lock_t *next_lock = NULL; - struct flock reserve_flock; + struct gf_flock reserve_flock; uint64_t fd_count = 0; local = frame->local; @@ -864,7 +864,7 @@ client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx) clnt_local_t *local = NULL; client_posix_lock_t *lock = NULL; - struct flock reserve_flock; + struct gf_flock reserve_flock; int ret = 0; local = GF_CALLOC (1, sizeof (*local), gf_client_mt_clnt_local_t); diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 84f3778393f..4297c628dc0 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1184,7 +1184,7 @@ out: int32_t client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { int ret = -1; clnt_conf_t *conf = NULL; @@ -1212,7 +1212,7 @@ out: int32_t client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, - loc_t *loc, int32_t cmd, struct flock *lock) + loc_t *loc, int32_t cmd, struct gf_flock *lock) { int ret = -1; clnt_conf_t *conf = NULL; @@ -1242,7 +1242,7 @@ out: int32_t client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, - fd_t *fd, int32_t cmd, struct flock *lock) + fd_t *fd, int32_t cmd, struct gf_flock *lock) { int ret = -1; clnt_conf_t *conf = NULL; diff --git a/xlators/protocol/client/src/client.h b/xlators/protocol/client/src/client.h index a31873a027b..1e90c5935cf 100644 --- a/xlators/protocol/client/src/client.h +++ b/xlators/protocol/client/src/client.h @@ -80,7 +80,7 @@ typedef struct _client_fd_ctx { typedef struct _client_posix_lock { fd_t *fd; /* The fd on which the lk operation was made */ - struct flock user_flock; /* the flock supplied by the user */ + struct gf_flock user_flock; /* the flock supplied by the user */ off_t fl_start; off_t fl_end; short fl_type; @@ -120,7 +120,7 @@ typedef struct client_args { loc_t *oldloc; loc_t *newloc; const char *name; - struct flock *flock; + struct gf_flock *flock; const char *volume; const char *basename; off_t offset; @@ -166,7 +166,7 @@ int clnt_readdir_rsp_cleanup (gfs3_readdir_rsp *rsp); int clnt_readdirp_rsp_cleanup (gfs3_readdirp_rsp *rsp); int client_attempt_lock_recovery (xlator_t *this, clnt_fd_ctx_t *fdctx); int32_t delete_granted_locks_owner (fd_t *fd, uint64_t owner); -int client_add_lock_for_recovery (fd_t *fd, struct flock *flock, uint64_t owner, +int client_add_lock_for_recovery (fd_t *fd, struct gf_flock *flock, uint64_t owner, int32_t cmd); uint64_t decrement_reopen_fd_count (xlator_t *this, clnt_conf_t *conf); int32_t delete_granted_locks_fd (clnt_fd_ctx_t *fdctx); diff --git a/xlators/protocol/client/src/client3_1-fops.c b/xlators/protocol/client/src/client3_1-fops.c index 31cf9301526..786db4c7903 100644 --- a/xlators/protocol/client/src/client3_1-fops.c +++ b/xlators/protocol/client/src/client3_1-fops.c @@ -1526,7 +1526,7 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count, { call_frame_t *frame = NULL; clnt_local_t *local = NULL; - struct flock lock = {0,}; + struct gf_flock lock = {0,}; gfs3_lk_rsp rsp = {0,}; int ret = 0; @@ -1548,7 +1548,7 @@ client3_1_lk_cbk (struct rpc_req *req, struct iovec *iov, int count, } if (rsp.op_ret >= 0) { - gf_flock_to_flock (&rsp.flock, &lock); + gf_proto_flock_to_flock (&rsp.flock, &lock); } /* Save the lock to the client lock cache to be able @@ -4377,7 +4377,7 @@ client3_1_lk (call_frame_t *frame, xlator_t *this, req.fd = fdctx->remote_fd; req.cmd = gf_cmd; req.type = gf_type; - gf_flock_from_flock (&req.flock, args->flock); + gf_proto_flock_from_flock (&req.flock, args->flock); ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_LK, client3_1_lk_cbk, NULL, xdr_from_lk_req, @@ -4443,7 +4443,7 @@ client3_1_inodelk (call_frame_t *frame, xlator_t *this, req.volume = (char *)args->volume; req.cmd = gf_cmd; req.type = gf_type; - gf_flock_from_flock (&req.flock, args->flock); + gf_proto_flock_from_flock (&req.flock, args->flock); conf = this->private; @@ -4533,7 +4533,7 @@ client3_1_finodelk (call_frame_t *frame, xlator_t *this, req.fd = fdctx->remote_fd; req.cmd = gf_cmd; req.type = gf_type; - gf_flock_from_flock (&req.flock, args->flock); + gf_proto_flock_from_flock (&req.flock, args->flock); ret = client_submit_request (this, &req, frame, conf->fops, GFS3_OP_FINODELK, diff --git a/xlators/protocol/legacy/client/src/client-protocol.c b/xlators/protocol/legacy/client/src/client-protocol.c index ebb4e6fcf96..c9ef0d9e347 100644 --- a/xlators/protocol/legacy/client/src/client-protocol.c +++ b/xlators/protocol/legacy/client/src/client-protocol.c @@ -2815,7 +2815,7 @@ unwind: int client_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *flock) + struct gf_flock *flock) { int ret = -1; gf_hdr_common_t *hdr = NULL; @@ -2912,7 +2912,7 @@ unwind: int client_inodelk (call_frame_t *frame, xlator_t *this, const char *volume, - loc_t *loc, int32_t cmd, struct flock *flock) + loc_t *loc, int32_t cmd, struct gf_flock *flock) { int ret = -1; gf_hdr_common_t *hdr = NULL; @@ -3007,7 +3007,7 @@ unwind: int client_finodelk (call_frame_t *frame, xlator_t *this, const char *volume, - fd_t *fd, int32_t cmd, struct flock *flock) + fd_t *fd, int32_t cmd, struct gf_flock *flock) { int ret = -1; gf_hdr_common_t *hdr = NULL; @@ -5046,7 +5046,7 @@ int client_lk_common_cbk (call_frame_t *frame, gf_hdr_common_t *hdr, size_t hdrlen, struct iobuf *iobuf) { - struct flock lock = {0,}; + struct gf_flock lock = {0,}; gf_fop_lk_rsp_t *rsp = NULL; int32_t op_ret = 0; int32_t op_errno = 0; diff --git a/xlators/protocol/legacy/lib/src/protocol.h b/xlators/protocol/legacy/lib/src/protocol.h index e929693d7d8..bc00450e186 100644 --- a/xlators/protocol/legacy/lib/src/protocol.h +++ b/xlators/protocol/legacy/lib/src/protocol.h @@ -299,7 +299,7 @@ struct gf_flock { static inline void -gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock) +gf_flock_to_flock (struct gf_flock *gf_flock, struct gf_flock *flock) { flock->l_type = ntoh16 (gf_flock->type); flock->l_whence = ntoh16 (gf_flock->whence); @@ -310,7 +310,7 @@ gf_flock_to_flock (struct gf_flock *gf_flock, struct flock *flock) static inline void -gf_flock_from_flock (struct gf_flock *gf_flock, struct flock *flock) +gf_flock_from_flock (struct gf_flock *gf_flock, struct gf_flock *flock) { gf_flock->type = hton16 (flock->l_type); gf_flock->whence = hton16 (flock->l_whence); diff --git a/xlators/protocol/legacy/server/src/server-helpers.c b/xlators/protocol/legacy/server/src/server-helpers.c index 08f89af5aba..b285d90ffba 100644 --- a/xlators/protocol/legacy/server/src/server-helpers.c +++ b/xlators/protocol/legacy/server/src/server-helpers.c @@ -162,7 +162,7 @@ do_lock_table_cleanup (xlator_t *this, server_connection_t *conn, { struct list_head file_lockers, dir_lockers; call_frame_t *tmp_frame = NULL; - struct flock flock = {0, }; + struct gf_flock flock = {0, }; xlator_t *bound_xl = NULL; struct _locker *locker = NULL, *tmp = NULL; int ret = -1; @@ -395,7 +395,7 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn) struct list_head dir_lockers; struct _lock_table *ltable = NULL; struct _locker *locker = NULL, *tmp = NULL; - struct flock flock = {0,}; + struct gf_flock flock = {0,}; fd_t *fd = NULL; int32_t i = 0; fdentry_t *fdentries = NULL; diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c index b2ce4bd116e..cbb9ce63589 100644 --- a/xlators/protocol/legacy/server/src/server-protocol.c +++ b/xlators/protocol/legacy/server/src/server-protocol.c @@ -463,7 +463,7 @@ gf_del_locker (struct _lock_table *table, const char *volume, */ static int server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { gf_hdr_common_t *hdr = NULL; gf_fop_lk_rsp_t *rsp = NULL; diff --git a/xlators/protocol/legacy/server/src/server-protocol.h b/xlators/protocol/legacy/server/src/server-protocol.h index 13691287132..e2e1738e969 100644 --- a/xlators/protocol/legacy/server/src/server-protocol.h +++ b/xlators/protocol/legacy/server/src/server-protocol.h @@ -182,7 +182,7 @@ struct _server_state { int mask; char is_revalidate; dict_t *dict; - struct flock flock; + struct gf_flock flock; const char *volume; dir_entry_t *entry; }; diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index 59a49897116..e63bc200211 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -281,7 +281,7 @@ do_lock_table_cleanup (xlator_t *this, server_connection_t *conn, { struct list_head file_lockers, dir_lockers; call_frame_t *tmp_frame = NULL; - struct flock flock = {0, }; + struct gf_flock flock = {0, }; xlator_t *bound_xl = NULL; struct _locker *locker = NULL, *tmp = NULL; int ret = -1; @@ -518,7 +518,7 @@ server_connection_destroy (xlator_t *this, server_connection_t *conn) struct list_head dir_lockers; struct _lock_table *ltable = NULL; struct _locker *locker = NULL, *tmp = NULL; - struct flock flock = {0,}; + struct gf_flock flock = {0,}; fd_t *fd = NULL; int32_t i = 0; fdentry_t *fdentries = NULL; diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h index a86c6b31824..5786ae5b588 100644 --- a/xlators/protocol/server/src/server.h +++ b/xlators/protocol/server/src/server.h @@ -185,7 +185,7 @@ struct _server_state { int mask; char is_revalidate; dict_t *dict; - struct flock flock; + struct gf_flock flock; const char *volume; dir_entry_t *entry; }; diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index f07be9bd7c6..1b0c407ee5e 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -172,7 +172,7 @@ out: int server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, - int32_t op_ret, int32_t op_errno, struct flock *lock) + int32_t op_ret, int32_t op_errno, struct gf_flock *lock) { gfs3_lk_rsp rsp = {0,}; rpcsvc_request_t *req = NULL; @@ -202,7 +202,7 @@ server_lk_cbk (call_frame_t *frame, void *cookie, xlator_t *this, break; } - gf_flock_from_flock (&rsp.flock, lock); + gf_proto_flock_from_flock (&rsp.flock, lock); } else if (op_errno != ENOSYS) { gf_log (this->name, GF_LOG_TRACE, "%"PRId64": LK %"PRId64" (%"PRId64") ==> %"PRId32" (%s)", @@ -4314,7 +4314,7 @@ server_inodelk (rpcsvc_request_t *req) state->type = args.type; state->volume = gf_strdup (args.volume); - gf_flock_to_flock (&args.flock, &state->flock); + gf_proto_flock_to_flock (&args.flock, &state->flock); switch (state->type) { case GF_LK_F_RDLCK: @@ -4385,7 +4385,7 @@ server_finodelk (rpcsvc_request_t *req) state->type = args.type; - gf_flock_to_flock (&args.flock, &state->flock); + gf_proto_flock_to_flock (&args.flock, &state->flock); switch (state->type) { case GF_LK_F_RDLCK: @@ -4820,7 +4820,7 @@ server_lk (rpcsvc_request_t *req) break; } - gf_flock_to_flock (&args.flock, &state->flock); + gf_proto_flock_to_flock (&args.flock, &state->flock); switch (state->type) { case GF_LK_F_RDLCK: diff --git a/xlators/storage/bdb/src/bdb.c b/xlators/storage/bdb/src/bdb.c index 6104728e3db..3b48fe4a45c 100644 --- a/xlators/storage/bdb/src/bdb.c +++ b/xlators/storage/bdb/src/bdb.c @@ -713,9 +713,9 @@ bdb_lk (call_frame_t *frame, xlator_t *this, fd_t *fd, int32_t cmd, - struct flock *lock) + struct gf_flock *lock) { - struct flock nullock = {0, }; + struct gf_flock nullock = {0, }; if (BDB_TIMED_LOG (ENOTSUP, gf_bdb_lk_log)) { gf_log (this->name, GF_LOG_DEBUG, @@ -3050,7 +3050,7 @@ out: int32_t bdb_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock) { gf_log (this->name, GF_LOG_ERROR, "glusterfs internal locking request. please load " @@ -3064,7 +3064,7 @@ bdb_inodelk (call_frame_t *frame, xlator_t *this, int32_t bdb_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock) { gf_log (this->name, GF_LOG_ERROR, "glusterfs internal locking request. please load " diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 6399d0bc048..398c1dd7e8b 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -3792,9 +3792,9 @@ static int gf_posix_lk_log; int32_t posix_lk (call_frame_t *frame, xlator_t *this, - fd_t *fd, int32_t cmd, struct flock *lock) + fd_t *fd, int32_t cmd, struct gf_flock *lock) { - struct flock nullock = {0, }; + struct gf_flock nullock = {0, }; gf_posix_lk_log++; @@ -3809,7 +3809,7 @@ posix_lk (call_frame_t *frame, xlator_t *this, int32_t posix_inodelk (call_frame_t *frame, xlator_t *this, - const char *volume, loc_t *loc, int32_t cmd, struct flock *lock) + const char *volume, loc_t *loc, int32_t cmd, struct gf_flock *lock) { gf_log (this->name, GF_LOG_CRITICAL, "\"features/locks\" translator is not loaded. " @@ -3821,7 +3821,7 @@ posix_inodelk (call_frame_t *frame, xlator_t *this, int32_t posix_finodelk (call_frame_t *frame, xlator_t *this, - const char *volume, fd_t *fd, int32_t cmd, struct flock *lock) + const char *volume, fd_t *fd, int32_t cmd, struct gf_flock *lock) { gf_log (this->name, GF_LOG_CRITICAL, "\"features/locks\" translator is not loaded. " -- cgit