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
nexedi
linux
Commits
6ff86498
Commit
6ff86498
authored
Dec 11, 2002
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFS] get rid of pb_daemon/pagebuf_daemon_t
SGI Modid: 2.5.x-xfs:slinx:134787a
parent
3952101e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
54 deletions
+33
-54
fs/xfs/pagebuf/page_buf.c
fs/xfs/pagebuf/page_buf.c
+33
-48
fs/xfs/pagebuf/page_buf_internal.h
fs/xfs/pagebuf/page_buf_internal.h
+0
-6
No files found.
fs/xfs/pagebuf/page_buf.c
View file @
6ff86498
...
...
@@ -118,7 +118,6 @@ pb_trace_func(
*/
STATIC
kmem_cache_t
*
pagebuf_cache
;
STATIC
pagebuf_daemon_t
*
pb_daemon
;
STATIC
void
pagebuf_daemon_wakeup
(
int
);
STATIC
struct
workqueue_struct
*
pagebuf_workqueue
;
...
...
@@ -1547,13 +1546,17 @@ pagebuf_iomove(
* Pagebuf delayed write buffer handling
*/
STATIC
int
pbd_active
=
1
;
STATIC
LIST_HEAD
(
pbd_delwrite_queue
);
STATIC
spinlock_t
pbd_delwrite_lock
=
SPIN_LOCK_UNLOCKED
;
void
pagebuf_delwri_queue
(
page_buf_t
*
pb
,
int
unlock
)
{
PB_TRACE
(
pb
,
PB_TRACE_REC
(
delwri_q
),
unlock
);
spin_lock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_lock
(
&
pb
d
_delwrite_lock
);
/* If already in the queue, dequeue and place at tail */
if
(
!
list_empty
(
&
pb
->
pb_list
))
{
if
(
unlock
)
{
...
...
@@ -1562,9 +1565,9 @@ pagebuf_delwri_queue(
list_del
(
&
pb
->
pb_list
);
}
list_add_tail
(
&
pb
->
pb_list
,
&
pb
_daemon
->
pb_delwrite_l
);
list_add_tail
(
&
pb
->
pb_list
,
&
pb
d_delwrite_queue
);
PBP
(
pb
)
->
pb_flushtime
=
jiffies
+
pb_params
.
p_un
.
age_buffer
;
spin_unlock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_unlock
(
&
pb
d
_delwrite_lock
);
if
(
unlock
&&
(
pb
->
pb_flags
&
_PBF_LOCKABLE
))
{
pagebuf_unlock
(
pb
);
...
...
@@ -1576,10 +1579,10 @@ pagebuf_delwri_dequeue(
page_buf_t
*
pb
)
{
PB_TRACE
(
pb
,
PB_TRACE_REC
(
delwri_uq
),
0
);
spin_lock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_lock
(
&
pb
d
_delwrite_lock
);
list_del_init
(
&
pb
->
pb_list
);
pb
->
pb_flags
&=
~
PBF_DELWRI
;
spin_unlock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_unlock
(
&
pb
d
_delwrite_lock
);
}
/* Defines for pagebuf daemon */
...
...
@@ -1622,7 +1625,7 @@ pagebuf_daemon(
INIT_LIST_HEAD
(
&
tmp
);
do
{
if
(
pb
_daemon
->
active
==
1
)
{
if
(
pb
d_
active
==
1
)
{
del_timer
(
&
pb_daemon_timer
);
pb_daemon_timer
.
expires
=
jiffies
+
pb_params
.
p_un
.
flush_interval
;
...
...
@@ -1630,14 +1633,14 @@ pagebuf_daemon(
interruptible_sleep_on
(
&
pbd_waitq
);
}
if
(
pb
_daemon
->
active
==
0
)
{
if
(
pb
d_
active
==
0
)
{
del_timer
(
&
pb_daemon_timer
);
}
spin_lock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_lock
(
&
pb
d
_delwrite_lock
);
count
=
0
;
list_for_each_safe
(
curr
,
next
,
&
pb
_daemon
->
pb_delwrite_l
)
{
list_for_each_safe
(
curr
,
next
,
&
pb
d_delwrite_queue
)
{
pb
=
list_entry
(
curr
,
page_buf_t
,
pb_list
);
PB_TRACE
(
pb
,
PB_TRACE_REC
(
walkq1
),
pagebuf_ispin
(
pb
));
...
...
@@ -1659,7 +1662,7 @@ pagebuf_daemon(
}
}
spin_unlock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_unlock
(
&
pb
d
_delwrite_lock
);
while
(
!
list_empty
(
&
tmp
))
{
pb
=
list_entry
(
tmp
.
next
,
page_buf_t
,
pb_list
);
list_del_init
(
&
pb
->
pb_list
);
...
...
@@ -1675,9 +1678,9 @@ pagebuf_daemon(
pagebuf_run_queues
(
NULL
);
force_flush
=
0
;
}
while
(
pb
_daemon
->
active
==
1
);
}
while
(
pb
d_
active
==
1
);
pb
_daemon
->
active
=
-
1
;
pb
d_
active
=
-
1
;
wake_up_interruptible
(
&
pbd_waitq
);
return
0
;
...
...
@@ -1693,10 +1696,10 @@ pagebuf_delwri_flush(
struct
list_head
*
curr
,
*
next
,
tmp
;
int
pincount
=
0
;
spin_lock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_lock
(
&
pb
d
_delwrite_lock
);
INIT_LIST_HEAD
(
&
tmp
);
list_for_each_safe
(
curr
,
next
,
&
pb
_daemon
->
pb_delwrite_l
)
{
list_for_each_safe
(
curr
,
next
,
&
pb
d_delwrite_queue
)
{
pb
=
list_entry
(
curr
,
page_buf_t
,
pb_list
);
/*
...
...
@@ -1727,7 +1730,7 @@ pagebuf_delwri_flush(
pb
->
pb_flags
&=
~
PBF_ASYNC
;
}
spin_unlock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_unlock
(
&
pb
d
_delwrite_lock
);
if
((
flags
&
PBDF_TRYLOCK
)
==
0
)
{
pagebuf_lock
(
pb
);
...
...
@@ -1738,10 +1741,10 @@ pagebuf_delwri_flush(
__pagebuf_iorequest
(
pb
);
spin_lock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_lock
(
&
pb
d
_delwrite_lock
);
}
spin_unlock
(
&
pb
_daemon
->
pb
_delwrite_lock
);
spin_unlock
(
&
pb
d
_delwrite_lock
);
pagebuf_run_queues
(
NULL
);
...
...
@@ -1765,26 +1768,17 @@ pagebuf_delwri_flush(
STATIC
int
pagebuf_daemon_start
(
void
)
{
if
(
!
pb_daemon
)
{
pb_daemon
=
(
pagebuf_daemon_t
*
)
kmalloc
(
sizeof
(
pagebuf_daemon_t
),
GFP_KERNEL
);
if
(
!
pb_daemon
)
{
return
-
1
;
/* error */
}
pb_daemon
->
active
=
1
;
pb_daemon
->
pb_delwrite_lock
=
SPIN_LOCK_UNLOCKED
;
int
rval
;
INIT_LIST_HEAD
(
&
pb_daemon
->
pb_delwrite_l
);
pagebuf_workqueue
=
create_workqueue
(
"pagebuf"
);
if
(
!
pagebuf_workqueue
)
return
-
ENOMEM
;
kernel_thread
(
pagebuf_daemon
,
(
void
*
)
pb_daemon
,
CLONE_FS
|
CLONE_FILES
|
CLONE_VM
);
rval
=
kernel_thread
(
pagebuf_daemon
,
NULL
,
CLONE_FS
|
CLONE_FILES
);
if
(
rval
<
0
)
destroy_workqueue
(
pagebuf_workqueue
);
pagebuf_workqueue
=
create_workqueue
(
"pagebuf"
);
if
(
!
pagebuf_workqueue
)
return
-
1
;
}
return
0
;
return
rval
;
}
/*
...
...
@@ -1795,19 +1789,10 @@ pagebuf_daemon_start(void)
STATIC
void
pagebuf_daemon_stop
(
void
)
{
if
(
pb_daemon
)
{
destroy_workqueue
(
pagebuf_workqueue
);
pb_daemon
->
active
=
0
;
wake_up_interruptible
(
&
pbd_waitq
);
while
(
pb_daemon
->
active
==
0
)
{
interruptible_sleep_on
(
&
pbd_waitq
);
}
kfree
(
pb_daemon
);
pb_daemon
=
NULL
;
}
pbd_active
=
0
;
wake_up_interruptible
(
&
pbd_waitq
);
wait_event_interruptible
(
pbd_waitq
,
pbd_active
);
destroy_workqueue
(
pagebuf_workqueue
);
}
...
...
fs/xfs/pagebuf/page_buf_internal.h
View file @
6ff86498
...
...
@@ -95,12 +95,6 @@ struct pagebuf_trace_buf {
#define PB_TRACE_BUFSIZE 1024
#define CIRC_INC(i) (((i) + 1) & (PB_TRACE_BUFSIZE - 1))
typedef
struct
pagebuf_daemon
{
int
active
;
spinlock_t
pb_delwrite_lock
;
struct
list_head
pb_delwrite_l
;
}
pagebuf_daemon_t
;
/*
* Tunable pagebuf parameters
*/
...
...
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