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
a0780cdf
Commit
a0780cdf
authored
Apr 03, 2002
by
Dave Kleikamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
JFS: simplify sync_metapage
Submitted by Christoph Hellwig
parent
e65af39e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
23 deletions
+31
-23
fs/jfs/jfs_metapage.c
fs/jfs/jfs_metapage.c
+17
-3
fs/jfs/jfs_metapage.h
fs/jfs/jfs_metapage.h
+14
-20
No files found.
fs/jfs/jfs_metapage.c
View file @
a0780cdf
...
...
@@ -511,10 +511,26 @@ static void __write_metapage(metapage_t * mp)
jFYI
(
1
,
(
"__write_metapage done
\n
"
));
}
static
inline
void
sync_metapage
(
metapage_t
*
mp
)
{
struct
page
*
page
=
mp
->
page
;
page_cache_get
(
page
);
lock_page
(
page
);
/* we're done with this page - no need to check for errors */
if
(
page
->
buffers
)
{
writeout_one_page
(
page
);
waitfor_one_page
(
page
);
}
UnlockPage
(
page
);
page_cache_release
(
page
);
}
void
release_metapage
(
metapage_t
*
mp
)
{
log_t
*
log
;
struct
inode
*
ip
;
jFYI
(
1
,
(
"release_metapage: mp = 0x%p, flag = 0x%lx
\n
"
,
mp
,
...
...
@@ -528,8 +544,6 @@ void release_metapage(metapage_t * mp)
return
;
}
ip
=
(
struct
inode
*
)
mp
->
mapping
->
host
;
assert
(
mp
->
count
);
if
(
--
mp
->
count
||
atomic_read
(
&
mp
->
nohomeok
))
{
unlock_metapage
(
mp
);
...
...
fs/jfs/jfs_metapage.h
View file @
a0780cdf
...
...
@@ -84,33 +84,27 @@ extern metapage_t *__get_metapage(struct inode *inode,
__get_metapage(inode, lblock, size, absolute, TRUE)
extern
void
release_metapage
(
metapage_t
*
);
extern
void
hold_metapage
(
metapage_t
*
,
int
);
#define flush_metapage(mp) \
{\
set_bit(META_dirty, &(mp)->flag);\
set_bit(META_sync, &(mp)->flag);\
release_metapage(mp);\
static
inline
void
write_metapage
(
metapage_t
*
mp
)
{
set_bit
(
META_dirty
,
&
mp
->
flag
);
release_metapage
(
mp
);
}
#define sync_metapage(mp) \
generic_buffer_fdatasync((struct inode *)mp->mapping->host,\
mp->page->index, mp->page->index + 1)
#define write_metapage(mp) \
{\
set_bit(META_dirty, &(mp)->flag);\
release_metapage(mp);\
static
inline
void
flush_metapage
(
metapage_t
*
mp
)
{
set_bit
(
META_sync
,
&
mp
->
flag
);
write_metapage
(
mp
);
}
#define discard_metapage(mp) \
{
\
clear_bit(META_dirty, &
(mp)->flag);\
set_bit(META_discard, &
(mp)->flag);\
release_metapage(mp);
\
static
inline
void
discard_metapage
(
metapage_t
*
mp
)
{
clear_bit
(
META_dirty
,
&
mp
->
flag
);
set_bit
(
META_discard
,
&
mp
->
flag
);
release_metapage
(
mp
);
}
extern
void
hold_metapage
(
metapage_t
*
,
int
);
/*
* This routine uses hash to explicitly find small number of pages
*/
...
...
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