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
3799a9a6
Commit
3799a9a6
authored
Jan 06, 2003
by
Dave Kleikamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JFS: Clean up flushing outstanding transactions to journal.
This is in preparation for sync_fs super_operation.
parent
cd8b462a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
36 deletions
+30
-36
fs/jfs/jfs_logmgr.c
fs/jfs/jfs_logmgr.c
+25
-26
fs/jfs/jfs_logmgr.h
fs/jfs/jfs_logmgr.h
+2
-1
fs/jfs/jfs_txnmgr.c
fs/jfs/jfs_txnmgr.c
+1
-7
fs/jfs/jfs_umount.c
fs/jfs/jfs_umount.c
+2
-2
No files found.
fs/jfs/jfs_logmgr.c
View file @
3799a9a6
...
...
@@ -184,9 +184,9 @@ static void lbmWrite(struct jfs_log * log, struct lbuf * bp, int flag, int cant_
static
void
lbmDirectWrite
(
struct
jfs_log
*
log
,
struct
lbuf
*
bp
,
int
flag
);
static
int
lbmIOWait
(
struct
lbuf
*
bp
,
int
flag
);
static
bio_end_io_t
lbmIODone
;
static
void
lbmStartIO
(
struct
lbuf
*
bp
);
static
void
lmGCwrite
(
struct
jfs_log
*
log
,
int
cant_block
);
void
lbmStartIO
(
struct
lbuf
*
bp
);
void
lmGCwrite
(
struct
jfs_log
*
log
,
int
cant_block
);
/*
...
...
@@ -744,7 +744,7 @@ int lmGroupCommit(struct jfs_log * log, struct tblock * tblk)
* LOGGC_LOCK must be held by caller.
* N.B. LOG_LOCK is NOT held during lmGroupCommit().
*/
void
lmGCwrite
(
struct
jfs_log
*
log
,
int
cant_write
)
static
void
lmGCwrite
(
struct
jfs_log
*
log
,
int
cant_write
)
{
struct
lbuf
*
bp
;
struct
logpage
*
lp
;
...
...
@@ -893,8 +893,7 @@ void lmPostGC(struct lbuf * bp)
*/
if
((
tblk
=
log
->
cqueue
.
head
)
&&
((
log
->
gcrtc
>
0
)
||
(
tblk
->
bp
->
l_wqnext
!=
NULL
)
||
test_bit
(
log_SYNCBARRIER
,
&
log
->
flag
)
||
test_bit
(
log_QUIESCE
,
&
log
->
flag
)))
test_bit
(
log_FLUSH
,
&
log
->
flag
)))
/*
* Call lmGCwrite with new group leader
*/
...
...
@@ -902,11 +901,13 @@ void lmPostGC(struct lbuf * bp)
/* no transaction are ready yet (transactions are only just
* queued (GC_QUEUE) and not entered for group commit yet).
*
let
the first transaction entering group commit
* will elect he
t
self as new group leader.
* the first transaction entering group commit
* will elect he
r
self as new group leader.
*/
else
else
{
log
->
cflag
&=
~
logGC_PAGEOUT
;
clear_bit
(
log_FLUSH
,
&
log
->
flag
);
}
//LOGGC_UNLOCK(log);
spin_unlock_irqrestore
(
&
log
->
gclock
,
flags
);
...
...
@@ -1049,18 +1050,12 @@ int lmLogSync(struct jfs_log * log, int nosyncwait)
set_bit
(
log_SYNCBARRIER
,
&
log
->
flag
);
jFYI
(
1
,
(
"log barrier on: lsn=0x%x syncpt=0x%x
\n
"
,
lsn
,
log
->
syncpt
));
/*
* We may have to initiate group commit
*/
jfs_flush_journal
(
log
,
0
);
}
/*
* We may have to initiate group commit
*/
LOGGC_LOCK
(
log
);
if
(
log
->
cqueue
.
head
&&
!
(
log
->
cflag
&
logGC_PAGEOUT
))
{
log
->
cflag
|=
logGC_PAGEOUT
;
lmGCwrite
(
log
,
0
);
}
LOGGC_UNLOCK
(
log
);
return
lsn
;
}
...
...
@@ -1416,21 +1411,22 @@ int lmLogClose(struct super_block *sb, struct jfs_log * log)
/*
* NAME:
lmLogWait
()
* NAME:
jfs_flush_journal
()
*
* FUNCTION: wait for all outstanding log records to be written to disk
* FUNCTION: initiate write of any outstanding transactions to the journal
* and optionally wait until they are all written to disk
*/
void
lmLogWait
(
struct
jfs_log
*
log
)
void
jfs_flush_journal
(
struct
jfs_log
*
log
,
int
wait
)
{
int
i
;
jFYI
(
1
,
(
"
lmLogWait: log:0x%p
\n
"
,
log
));
jFYI
(
1
,
(
"
jfs_flush_journal: log:0x%p wait=%d
\n
"
,
log
,
wait
));
/*
* This ensures that we will keep writing to the journal as long
* as there are unwritten commit records
*/
set_bit
(
log_
QUIESCE
,
&
log
->
flag
);
set_bit
(
log_
FLUSH
,
&
log
->
flag
);
/*
* Initiate I/O on outstanding transactions
...
...
@@ -1442,6 +1438,9 @@ void lmLogWait(struct jfs_log *log)
}
LOGGC_UNLOCK
(
log
);
if
(
!
wait
)
return
;
if
(
log
->
cqueue
.
head
||
!
list_empty
(
&
log
->
synclist
))
{
/*
* If there was very recent activity, we may need to wait
...
...
@@ -1459,7 +1458,7 @@ void lmLogWait(struct jfs_log *log)
assert
(
log
->
cqueue
.
head
==
NULL
);
assert
(
list_empty
(
&
log
->
synclist
));
clear_bit
(
log_
QUIESCE
,
&
log
->
flag
);
/* Probably not needed */
clear_bit
(
log_
FLUSH
,
&
log
->
flag
);
}
/*
...
...
@@ -1488,7 +1487,7 @@ int lmLogShutdown(struct jfs_log * log)
jFYI
(
1
,
(
"lmLogShutdown: log:0x%p
\n
"
,
log
));
lmLogWait
(
log
);
jfs_flush_journal
(
log
,
1
);
/*
* We need to make sure all of the "written" metapages
...
...
@@ -1946,7 +1945,7 @@ static void lbmDirectWrite(struct jfs_log * log, struct lbuf * bp, int flag)
*
* serialization: LCACHE_LOCK() is NOT held during log i/o;
*/
void
lbmStartIO
(
struct
lbuf
*
bp
)
static
void
lbmStartIO
(
struct
lbuf
*
bp
)
{
struct
bio
*
bio
;
struct
jfs_log
*
log
=
bp
->
l_log
;
...
...
fs/jfs/jfs_logmgr.h
View file @
3799a9a6
...
...
@@ -424,6 +424,7 @@ struct jfs_log {
#define log_INLINELOG 1
#define log_SYNCBARRIER 2
#define log_QUIESCE 3
#define log_FLUSH 4
/*
* group commit flag
...
...
@@ -501,11 +502,11 @@ struct logsyncblk {
}
extern
int
lmLogOpen
(
struct
super_block
*
sb
,
struct
jfs_log
**
log
);
extern
void
lmLogWait
(
struct
jfs_log
*
log
);
extern
int
lmLogClose
(
struct
super_block
*
sb
,
struct
jfs_log
*
log
);
extern
int
lmLogSync
(
struct
jfs_log
*
log
,
int
nosyncwait
);
extern
int
lmLogShutdown
(
struct
jfs_log
*
log
);
extern
int
lmLogInit
(
struct
jfs_log
*
log
);
extern
int
lmLogFormat
(
struct
jfs_log
*
log
,
s64
logAddress
,
int
logSize
);
extern
void
jfs_flush_journal
(
struct
jfs_log
*
log
,
int
wait
);
#endif
/* _H_JFS_LOGMGR */
fs/jfs/jfs_txnmgr.c
View file @
3799a9a6
...
...
@@ -158,7 +158,6 @@ struct {
* external references
*/
extern
int
lmGroupCommit
(
struct
jfs_log
*
,
struct
tblock
*
);
extern
int
lmGCwrite
(
struct
jfs_log
*
,
int
);
extern
void
lmSync
(
struct
jfs_log
*
);
extern
int
jfs_commit_inode
(
struct
inode
*
,
int
);
extern
int
jfs_stop_threads
;
...
...
@@ -2969,12 +2968,7 @@ void txQuiesce(struct super_block *sb)
/*
* We may need to kick off the group commit
*/
spin_lock_irq
(
&
log
->
gclock
);
// LOGGC_LOCK
if
(
log
->
cqueue
.
head
&&
!
(
log
->
cflag
&
logGC_PAGEOUT
))
{
log
->
cflag
|=
logGC_PAGEOUT
;
lmGCwrite
(
log
,
0
);
}
spin_unlock_irq
(
&
log
->
gclock
);
// LOGGC_UNLOCK
jfs_flush_journal
(
log
,
0
);
}
/*
...
...
fs/jfs/jfs_umount.c
View file @
3799a9a6
...
...
@@ -69,7 +69,7 @@ int jfs_umount(struct super_block *sb)
/*
* Wait for outstanding transactions to be written to log:
*/
lmLogWait
(
log
);
jfs_flush_journal
(
log
,
1
);
/*
* close fileset inode allocation map (aka fileset inode)
...
...
@@ -153,7 +153,7 @@ int jfs_umount_rw(struct super_block *sb)
*
* remove file system from log active file system list.
*/
lmLogWait
(
log
);
jfs_flush_journal
(
log
,
1
);
/*
* Make sure all metadata makes it to disk
...
...
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