Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300042
b: refs/heads/master
c: 4f988f1
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed May 4, 2012
1 parent 64adc5d commit 143441f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f624278626677bfaf73fef97f86b37981621f5c
refs/heads/master: 4f988f152ee087831ea5c1c77cda4454cacc052c
21 changes: 21 additions & 0 deletions trunk/include/linux/seqlock.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,27 @@ static inline unsigned read_seqcount_begin(const seqcount_t *s)
return ret;
}

/**
* raw_seqcount_begin - begin a seq-read critical section
* @s: pointer to seqcount_t
* Returns: count to be passed to read_seqcount_retry
*
* raw_seqcount_begin opens a read critical section of the given seqcount.
* Validity of the critical section is tested by checking read_seqcount_retry
* function.
*
* Unlike read_seqcount_begin(), this function will not wait for the count
* to stabilize. If a writer is active when we begin, we will fail the
* read_seqcount_retry() instead of stabilizing at the beginning of the
* critical section.
*/
static inline unsigned raw_seqcount_begin(const seqcount_t *s)
{
unsigned ret = ACCESS_ONCE(s->sequence);
smp_rmb();
return ret & ~1;
}

/**
* __read_seqcount_retry - end a seq-read critical section (without barrier)
* @s: pointer to seqcount_t
Expand Down

0 comments on commit 143441f

Please sign in to comment.