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
fec6fe9c
Commit
fec6fe9c
authored
22 years ago
by
Christoph Hellwig
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] XFS updates for workqueues
parent
a57e7142
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
14 deletions
+24
-14
fs/xfs/pagebuf/page_buf.c
fs/xfs/pagebuf/page_buf.c
+15
-6
fs/xfs/pagebuf/page_buf.h
fs/xfs/pagebuf/page_buf.h
+4
-2
fs/xfs/xfs_log.c
fs/xfs/xfs_log.c
+3
-4
fs/xfs/xfs_log_priv.h
fs/xfs/xfs_log_priv.h
+2
-2
No files found.
fs/xfs/pagebuf/page_buf.c
View file @
fec6fe9c
...
...
@@ -178,6 +178,11 @@ pagebuf_param_t pb_params = {{ HZ, 15 * HZ, 0, 0 }};
struct
pbstats
pbstats
;
/*
* Queue for delayed I/O completion.
*/
struct
workqueue_struct
*
pagebuf_workqueue
;
/*
* Pagebuf allocation / freeing.
*/
...
...
@@ -1167,7 +1172,7 @@ _pagebuf_wait_unpin(
* present, will be called as a side-effect.
*/
void
pagebuf_iodone_
sched
(
pagebuf_iodone_
work
(
void
*
v
)
{
page_buf_t
*
pb
=
(
page_buf_t
*
)
v
;
...
...
@@ -1196,11 +1201,8 @@ pagebuf_iodone(
PB_TRACE
(
pb
,
PB_TRACE_REC
(
done
),
pb
->
pb_iodone
);
if
((
pb
->
pb_iodone
)
||
(
pb
->
pb_flags
&
PBF_ASYNC
))
{
INIT_TQUEUE
(
&
pb
->
pb_iodone_sched
,
pagebuf_iodone_sched
,
(
void
*
)
pb
);
schedule_task
(
&
pb
->
pb_iodone_sched
);
INIT_WORK
(
&
pb
->
pb_iodone_work
,
pagebuf_iodone_work
,
pb
);
queue_work
(
pagebuf_workqueue
,
&
pb
->
pb_iodone_work
);
}
else
{
up
(
&
pb
->
pb_iodonesema
);
}
...
...
@@ -1854,6 +1856,10 @@ pagebuf_daemon_start(void)
kernel_thread
(
pagebuf_daemon
,
(
void
*
)
pb_daemon
,
CLONE_FS
|
CLONE_FILES
|
CLONE_VM
);
pagebuf_workqueue
=
create_workqueue
(
"pagebuf"
);
if
(
!
pagebuf_workqueue
)
return
-
1
;
}
return
0
;
}
...
...
@@ -1867,6 +1873,9 @@ STATIC void
pagebuf_daemon_stop
(
void
)
{
if
(
pb_daemon
)
{
flush_workqueue
(
pagebuf_workqueue
);
destroy_workqueue
(
pagebuf_workqueue
);
pb_daemon
->
active
=
0
;
pb_daemon
->
io_active
=
0
;
...
...
This diff is collapsed.
Click to expand it.
fs/xfs/pagebuf/page_buf.h
View file @
fec6fe9c
...
...
@@ -47,7 +47,7 @@
#include <linux/fs.h>
#include <linux/buffer_head.h>
#include <linux/uio.h>
#include <linux/
t
queue.h>
#include <linux/
work
queue.h>
enum
xfs_buffer_state
{
BH_Delay
=
BH_PrivateStart
};
BUFFER_FNS
(
Delay
,
delay
);
...
...
@@ -214,7 +214,7 @@ typedef struct page_buf_s {
size_t
pb_buffer_length
;
/* size of buffer in bytes */
size_t
pb_count_desired
;
/* desired transfer size */
void
*
pb_addr
;
/* virtual address of buffer */
struct
tq_struct
pb_iodone_sched
;
struct
work_struct
pb_iodone_work
;
page_buf_iodone_t
pb_iodone
;
/* I/O completion function */
page_buf_relse_t
pb_relse
;
/* releasing function */
page_buf_bdstrat_t
pb_strat
;
/* pre-write function */
...
...
@@ -395,4 +395,6 @@ static __inline__ int __pagebuf_iorequest(page_buf_t *pb)
return
pagebuf_iorequest
(
pb
);
}
extern
struct
workqueue_struct
*
pagebuf_workqueue
;
#endif
/* __PAGE_BUF_H__ */
This diff is collapsed.
Click to expand it.
fs/xfs/xfs_log.c
View file @
fec6fe9c
...
...
@@ -2714,7 +2714,7 @@ xlog_state_put_ticket(xlog_t *log,
LOG_UNLOCK
(
log
,
s
);
}
/* xlog_state_put_ticket */
void
xlog_sync_
sched
(
void
xlog_sync_
work
(
void
*
v
)
{
xlog_in_core_t
*
iclog
=
(
xlog_in_core_t
*
)
v
;
...
...
@@ -2773,13 +2773,12 @@ xlog_state_release_iclog(xlog_t *log,
* flags after this point.
*/
if
(
sync
)
{
INIT_TQUEUE
(
&
iclog
->
ic_write_sched
,
xlog_sync_sched
,
(
void
*
)
iclog
);
INIT_WORK
(
&
iclog
->
ic_write_work
,
xlog_sync_work
,
iclog
);
switch
(
xlog_mode
)
{
case
0
:
return
xlog_sync
(
log
,
iclog
,
0
);
case
1
:
pagebuf_queue_task
(
&
iclog
->
ic_write_sched
);
queue_work
(
pagebuf_workqueue
,
&
iclog
->
ic_write_work
);
}
}
return
(
0
);
...
...
This diff is collapsed.
Click to expand it.
fs/xfs/xfs_log_priv.h
View file @
fec6fe9c
...
...
@@ -438,7 +438,7 @@ typedef struct xlog_iclog_fields {
int
ic_bwritecnt
;
ushort_t
ic_state
;
char
*
ic_datap
;
/* pointer to iclog data */
struct
tq_struct
ic_write_sched
;
struct
work_struct
ic_write_work
;
}
xlog_iclog_fields_t
;
typedef
struct
xlog_in_core2
{
...
...
@@ -458,7 +458,7 @@ typedef struct xlog_in_core {
* Defines to save our code from this glop.
*/
#define ic_forcesema hic_fields.ic_forcesema
#define ic_write_
sched hic_fields.ic_write_sched
#define ic_write_
work hic_fields.ic_write_work
#define ic_next hic_fields.ic_next
#define ic_prev hic_fields.ic_prev
#define ic_bp hic_fields.ic_bp
...
...
This diff is collapsed.
Click to expand it.
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