aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_log_priv.h
diff options
context:
space:
mode:
authorDave Chinner <dchinner@redhat.com>2010-12-04 00:02:40 +1100
committerDave Chinner <david@fromorbit.com>2010-12-04 00:02:40 +1100
commitc8a09ff8ca2235bccdaea8a52fbd5349646a8ba4 (patch)
treea06b4fa59672fd6fa9dd884e1e0bc746adc011b6 /fs/xfs/xfs_log_priv.h
parent1c3cb9ec07fabf0c0970adc46fd2a1f09c1186dd (diff)
downloadkernel_samsung_smdk4412-c8a09ff8ca2235bccdaea8a52fbd5349646a8ba4.zip
kernel_samsung_smdk4412-c8a09ff8ca2235bccdaea8a52fbd5349646a8ba4.tar.gz
kernel_samsung_smdk4412-c8a09ff8ca2235bccdaea8a52fbd5349646a8ba4.tar.bz2
xfs: convert log grant heads to atomic variables
Convert the log grant heads to atomic64_t types in preparation for converting the accounting algorithms to atomic operations. his patch just converts the variables; the algorithmic changes are in a separate patch for clarity. Signed-off-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/xfs/xfs_log_priv.h')
-rw-r--r--fs/xfs/xfs_log_priv.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h
index d34af1c..7619d6a 100644
--- a/fs/xfs/xfs_log_priv.h
+++ b/fs/xfs/xfs_log_priv.h
@@ -514,8 +514,8 @@ typedef struct log {
spinlock_t l_grant_lock ____cacheline_aligned_in_smp;
struct list_head l_reserveq;
struct list_head l_writeq;
- int64_t l_grant_reserve_head;
- int64_t l_grant_write_head;
+ atomic64_t l_grant_reserve_head;
+ atomic64_t l_grant_write_head;
/*
* l_last_sync_lsn and l_tail_lsn are atomics so they can be set and
@@ -596,18 +596,18 @@ xlog_assign_atomic_lsn(atomic64_t *lsn, uint cycle, uint block)
* will always get consistent component values to work from.
*/
static inline void
-xlog_crack_grant_head(int64_t *head, int *cycle, int *space)
+xlog_crack_grant_head(atomic64_t *head, int *cycle, int *space)
{
- int64_t val = *head;
+ int64_t val = atomic64_read(head);
*cycle = val >> 32;
*space = val & 0xffffffff;
}
static inline void
-xlog_assign_grant_head(int64_t *head, int cycle, int space)
+xlog_assign_grant_head(atomic64_t *head, int cycle, int space)
{
- *head = ((int64_t)cycle << 32) | space;
+ atomic64_set(head, ((int64_t)cycle << 32) | space);
}
/*