From 6fdf8f4c7d5cced776c925052eb8a81c332a3573 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Mon, 4 May 2009 10:59:18 -0700 Subject: Do not lock entire file for metadata operations. Metadata operations now lock only a single byte at offset (LLONG_MAX - 1) instead of the whole file, to avoid contention with writev(). Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr-inode-write.c | 14 +++++++------- xlators/cluster/afr/src/afr.c | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'xlators/cluster/afr') diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 2b9d4d99b..57fdf20d5 100644 --- a/xlators/cluster/afr/src/afr-inode-write.c +++ b/xlators/cluster/afr/src/afr-inode-write.c @@ -224,7 +224,7 @@ afr_chmod (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, loc); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); @@ -418,7 +418,7 @@ afr_fchmod (call_frame_t *frame, xlator_t *this, local->fd = fd_ref (fd); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); @@ -614,7 +614,7 @@ afr_chown (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, loc); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); @@ -811,7 +811,7 @@ afr_fchown (call_frame_t *frame, xlator_t *this, local->fd = fd_ref (fd); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); @@ -1616,7 +1616,7 @@ afr_utimens (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, loc); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); @@ -1806,7 +1806,7 @@ afr_setxattr (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, loc); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); @@ -1995,7 +1995,7 @@ afr_removexattr (call_frame_t *frame, xlator_t *this, loc_copy (&local->loc, loc); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_METADATA_TRANSACTION); diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index a20cf7921..9021b8820 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -1068,7 +1068,7 @@ afr_flush (call_frame_t *frame, xlator_t *this, fd_t *fd) local->fd = fd_ref (fd); local->transaction.main_frame = frame; - local->transaction.start = 0; + local->transaction.start = LLONG_MAX - 1; local->transaction.len = 0; afr_transaction (transaction_frame, this, AFR_FLUSH_TRANSACTION); -- cgit