Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
fbf4d7e3
Commit
fbf4d7e3
authored
Jun 11, 2010
by
Andy Grover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RDS: Remove unused XLIST_PTR_TAIL and xlist_protect()
Not used. Signed-off-by:
Andy Grover
<
andy.grover@oracle.com
>
parent
c9455d99
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
42 deletions
+12
-42
net/rds/xlist.h
net/rds/xlist.h
+12
-42
No files found.
net/rds/xlist.h
View file @
fbf4d7e3
...
...
@@ -10,13 +10,18 @@ struct xlist_head {
struct
xlist_head
*
next
;
};
/*
* XLIST_PTR_TAIL can be used to prevent double insertion. See
* xlist_protect()
*/
#define XLIST_PTR_TAIL ((struct xlist_head *)0x1)
static
inline
void
INIT_XLIST_HEAD
(
struct
xlist_head
*
list
)
{
list
->
next
=
NULL
;
}
static
inline
int
xlist_empty
(
struct
xlist_head
*
head
)
{
return
head
->
next
==
NULL
;
}
static
inline
void
xlist_add
(
struct
xlist_head
*
new
,
struct
xlist_head
*
tail
,
struct
xlist_head
*
head
)
static
inline
void
xlist_add
(
struct
xlist_head
*
new
,
struct
xlist_head
*
tail
,
struct
xlist_head
*
head
)
{
struct
xlist_head
*
cur
;
struct
xlist_head
*
check
;
...
...
@@ -30,26 +35,6 @@ static inline void xlist_add(struct xlist_head *new, struct xlist_head *tail, st
}
}
/*
* To avoid duplicate insertion by two CPUs of the same xlist item
* you can call xlist_protect. It will stuff XLIST_PTR_TAIL
* into the entry->next pointer with xchg, and only return 1
* if there was a NULL there before.
*
* if xlist_protect returns zero, someone else is busy working
* on this entry. Getting a NULL into the entry in a race
* free manner is the caller's job.
*/
static
inline
int
xlist_protect
(
struct
xlist_head
*
entry
)
{
struct
xlist_head
*
val
;
val
=
xchg
(
&
entry
->
next
,
XLIST_PTR_TAIL
);
if
(
val
==
NULL
)
return
1
;
return
0
;
}
static
inline
struct
xlist_head
*
xlist_del_head
(
struct
xlist_head
*
head
)
{
struct
xlist_head
*
cur
;
...
...
@@ -61,11 +46,6 @@ static inline struct xlist_head *xlist_del_head(struct xlist_head *head)
if
(
!
cur
)
goto
out
;
if
(
cur
==
XLIST_PTR_TAIL
)
{
cur
=
NULL
;
goto
out
;
}
next
=
cur
->
next
;
check
=
cmpxchg
(
&
head
->
next
,
cur
,
next
);
if
(
check
==
cur
)
...
...
@@ -80,7 +60,7 @@ static inline struct xlist_head *xlist_del_head_fast(struct xlist_head *head)
struct
xlist_head
*
cur
;
cur
=
head
->
next
;
if
(
!
cur
||
cur
==
XLIST_PTR_TAIL
)
if
(
!
cur
)
return
NULL
;
head
->
next
=
cur
->
next
;
...
...
@@ -97,14 +77,4 @@ static inline void xlist_splice(struct xlist_head *list,
head
->
next
=
cur
;
}
static
inline
void
INIT_XLIST_HEAD
(
struct
xlist_head
*
list
)
{
list
->
next
=
NULL
;
}
static
inline
int
xlist_empty
(
struct
xlist_head
*
head
)
{
return
head
->
next
==
NULL
||
head
->
next
==
XLIST_PTR_TAIL
;
}
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment