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
cea83e2a
Commit
cea83e2a
authored
Jun 06, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/hlist-2.5
into home.transmeta.com:/home/torvalds/v2.5/linux
parents
d5eef605
567d401e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
7 deletions
+35
-7
fs/dcache.c
fs/dcache.c
+0
-3
fs/inode.c
fs/inode.c
+1
-3
include/linux/list.h
include/linux/list.h
+34
-1
No files found.
fs/dcache.c
View file @
cea83e2a
...
@@ -984,8 +984,6 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
...
@@ -984,8 +984,6 @@ struct dentry * __d_lookup(struct dentry * parent, struct qstr * name)
unsigned
long
move_count
;
unsigned
long
move_count
;
struct
qstr
*
qstr
;
struct
qstr
*
qstr
;
prefetch
(
node
->
next
);
smp_read_barrier_depends
();
smp_read_barrier_depends
();
dentry
=
hlist_entry
(
node
,
struct
dentry
,
d_hash
);
dentry
=
hlist_entry
(
node
,
struct
dentry
,
d_hash
);
...
@@ -1072,7 +1070,6 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
...
@@ -1072,7 +1070,6 @@ int d_validate(struct dentry *dentry, struct dentry *dparent)
spin_lock
(
&
dcache_lock
);
spin_lock
(
&
dcache_lock
);
base
=
d_hash
(
dparent
,
dentry
->
d_name
.
hash
);
base
=
d_hash
(
dparent
,
dentry
->
d_name
.
hash
);
hlist_for_each
(
lhp
,
base
)
{
hlist_for_each
(
lhp
,
base
)
{
prefetch
(
lhp
->
next
);
/* read_barrier_depends() not required for d_hash list
/* read_barrier_depends() not required for d_hash list
* as it is parsed under dcache_lock
* as it is parsed under dcache_lock
*/
*/
...
...
fs/inode.c
View file @
cea83e2a
...
@@ -484,7 +484,6 @@ static struct inode * find_inode(struct super_block * sb, struct hlist_head *hea
...
@@ -484,7 +484,6 @@ static struct inode * find_inode(struct super_block * sb, struct hlist_head *hea
repeat:
repeat:
hlist_for_each
(
node
,
head
)
{
hlist_for_each
(
node
,
head
)
{
prefetch
(
node
->
next
);
inode
=
hlist_entry
(
node
,
struct
inode
,
i_hash
);
inode
=
hlist_entry
(
node
,
struct
inode
,
i_hash
);
if
(
inode
->
i_sb
!=
sb
)
if
(
inode
->
i_sb
!=
sb
)
continue
;
continue
;
...
@@ -510,8 +509,7 @@ static struct inode * find_inode_fast(struct super_block * sb, struct hlist_head
...
@@ -510,8 +509,7 @@ static struct inode * find_inode_fast(struct super_block * sb, struct hlist_head
repeat:
repeat:
hlist_for_each
(
node
,
head
)
{
hlist_for_each
(
node
,
head
)
{
prefetch
(
node
->
next
);
inode
=
hlist_entry
(
node
,
struct
inode
,
i_hash
);
inode
=
list_entry
(
node
,
struct
inode
,
i_hash
);
if
(
inode
->
i_ino
!=
ino
)
if
(
inode
->
i_ino
!=
ino
)
continue
;
continue
;
if
(
inode
->
i_sb
!=
sb
)
if
(
inode
->
i_sb
!=
sb
)
...
...
include/linux/list.h
View file @
cea83e2a
...
@@ -443,17 +443,50 @@ static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node
...
@@ -443,17 +443,50 @@ static __inline__ void hlist_add_before(struct hlist_node *n, struct hlist_node
*
(
n
->
pprev
)
=
n
;
*
(
n
->
pprev
)
=
n
;
}
}
static
__inline__
void
hlist_add_after
(
struct
hlist_node
*
n
,
struct
hlist_node
*
next
)
{
next
->
next
=
n
->
next
;
*
(
next
->
pprev
)
=
n
;
n
->
next
=
next
;
}
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
/* Cannot easily do prefetch unfortunately */
/* Cannot easily do prefetch unfortunately */
#define hlist_for_each(pos, head) \
#define hlist_for_each(pos, head) \
for (pos = (head)->first; pos; \
for (pos = (head)->first; pos
&& ({ prefetch(pos->next); 1; })
; \
pos = pos->next)
pos = pos->next)
#define hlist_for_each_safe(pos, n, head) \
#define hlist_for_each_safe(pos, n, head) \
for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
for (pos = (head)->first; n = pos ? pos->next : 0, pos; \
pos = n)
pos = n)
/**
* hlist_for_each_entry - iterate over list of given type
* @tpos: the type * to use as a loop counter.
* @pos: the &struct hlist_node to use as a loop counter.
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry(tpos, pos, head, member) \
for (pos = (head)->first; \
pos && ({ prefetch(pos->next); 1;}) && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = pos->next)
/**
* hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
* @tpos: the type * to use as a loop counter.
* @pos: the &struct hlist_node to use as a loop counter.
* @n: another &struct hlist_node to use as temporary storage
* @head: the head for your list.
* @member: the name of the hlist_node within the struct.
*/
#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \
for (pos = (head)->first; \
pos && ({ n = pos->next; 1; }) && \
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
pos = n)
#else
#else
#warning "don't include kernel headers in userspace"
#warning "don't include kernel headers in userspace"
#endif
/* __KERNEL__ */
#endif
/* __KERNEL__ */
...
...
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