summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorVikas Gorur <vikas@gluster.com>2009-05-04 10:59:18 -0700
committerAnand V. Avati <avati@amp.gluster.com>2009-05-05 12:11:54 +0530
commit6fdf8f4c7d5cced776c925052eb8a81c332a3573 (patch)
tree6fddfb15b404334eb1bbda9b7d2d2609b1a26843 /xlators
parent1a5bcf508b22c1f9f5bd2f555e290f6725035cd2 (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')
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c14
-rw-r--r--xlators/cluster/afr/src/afr.c2
2 files changed, 8 insertions, 8 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);
diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c
index a20cf792170..9021b8820ff 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);