diff options
author | Vikas Gorur <vikas@gluster.com> | 2009-05-04 10:59:18 -0700 |
---|---|---|
committer | Anand V. Avati <avati@amp.gluster.com> | 2009-05-05 12:11:54 +0530 |
commit | 6fdf8f4c7d5cced776c925052eb8a81c332a3573 (patch) | |
tree | 6fddfb15b404334eb1bbda9b7d2d2609b1a26843 /xlators/cluster/afr/src/afr-inode-write.c | |
parent | 1a5bcf508b22c1f9f5bd2f555e290f6725035cd2 (diff) |
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 <avati@amp.gluster.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-write.c')
-rw-r--r-- | xlators/cluster/afr/src/afr-inode-write.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c index 2b9d4d99b48..57fdf20d550 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); |