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
7da08fd1
Commit
7da08fd1
authored
Jun 07, 2010
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
convert logfs to ->evict_inode()
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
8e22c1a4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
36 deletions
+31
-36
fs/logfs/inode.c
fs/logfs/inode.c
+1
-2
fs/logfs/logfs.h
fs/logfs/logfs.h
+1
-2
fs/logfs/readwrite.c
fs/logfs/readwrite.c
+29
-32
No files found.
fs/logfs/inode.c
View file @
7da08fd1
...
...
@@ -373,9 +373,8 @@ static void logfs_put_super(struct super_block *sb)
const
struct
super_operations
logfs_super_operations
=
{
.
alloc_inode
=
logfs_alloc_inode
,
.
clear_inode
=
logfs_clear_inode
,
.
delete_inode
=
logfs_delete_inode
,
.
destroy_inode
=
logfs_destroy_inode
,
.
evict_inode
=
logfs_evict_inode
,
.
drop_inode
=
logfs_drop_inode
,
.
put_super
=
logfs_put_super
,
.
write_inode
=
logfs_write_inode
,
...
...
fs/logfs/logfs.h
View file @
7da08fd1
...
...
@@ -529,8 +529,7 @@ void logfs_set_blocks(struct inode *inode, u64 no);
/* these logically belong into inode.c but actually reside in readwrite.c */
int
logfs_read_inode
(
struct
inode
*
inode
);
int
__logfs_write_inode
(
struct
inode
*
inode
,
long
flags
);
void
logfs_delete_inode
(
struct
inode
*
inode
);
void
logfs_clear_inode
(
struct
inode
*
inode
);
void
logfs_evict_inode
(
struct
inode
*
inode
);
/* journal.c */
void
logfs_write_anchor
(
struct
super_block
*
sb
);
...
...
fs/logfs/readwrite.c
View file @
7da08fd1
...
...
@@ -1972,31 +1972,6 @@ static struct page *inode_to_page(struct inode *inode)
return
page
;
}
/* Cheaper version of write_inode. All changes are concealed in
* aliases, which are moved back. No write to the medium happens.
*/
void
logfs_clear_inode
(
struct
inode
*
inode
)
{
struct
super_block
*
sb
=
inode
->
i_sb
;
struct
logfs_inode
*
li
=
logfs_inode
(
inode
);
struct
logfs_block
*
block
=
li
->
li_block
;
struct
page
*
page
;
/* Only deleted files may be dirty at this point */
BUG_ON
(
inode
->
i_state
&
I_DIRTY
&&
inode
->
i_nlink
);
if
(
!
block
)
return
;
if
((
logfs_super
(
sb
)
->
s_flags
&
LOGFS_SB_FLAG_SHUTDOWN
))
{
block
->
ops
->
free_block
(
inode
->
i_sb
,
block
);
return
;
}
BUG_ON
(
inode
->
i_ino
<
LOGFS_RESERVED_INOS
);
page
=
inode_to_page
(
inode
);
BUG_ON
(
!
page
);
/* FIXME: Use emergency page */
logfs_put_write_page
(
page
);
}
static
int
do_write_inode
(
struct
inode
*
inode
)
{
struct
super_block
*
sb
=
inode
->
i_sb
;
...
...
@@ -2164,18 +2139,40 @@ static int do_delete_inode(struct inode *inode)
* ZOMBIE inodes have already been deleted before and should remain dead,
* if it weren't for valid checking. No need to kill them again here.
*/
void
logfs_
delete
_inode
(
struct
inode
*
inode
)
void
logfs_
evict
_inode
(
struct
inode
*
inode
)
{
struct
super_block
*
sb
=
inode
->
i_sb
;
struct
logfs_inode
*
li
=
logfs_inode
(
inode
);
struct
logfs_block
*
block
=
li
->
li_block
;
struct
page
*
page
;
if
(
!
(
li
->
li_flags
&
LOGFS_IF_ZOMBIE
))
{
li
->
li_flags
|=
LOGFS_IF_ZOMBIE
;
if
(
i_size_read
(
inode
)
>
0
)
logfs_truncate
(
inode
,
0
);
do_delete_inode
(
inode
);
if
(
!
inode
->
i_nlink
)
{
if
(
!
(
li
->
li_flags
&
LOGFS_IF_ZOMBIE
))
{
li
->
li_flags
|=
LOGFS_IF_ZOMBIE
;
if
(
i_size_read
(
inode
)
>
0
)
logfs_truncate
(
inode
,
0
);
do_delete_inode
(
inode
);
}
}
truncate_inode_pages
(
&
inode
->
i_data
,
0
);
clear_inode
(
inode
);
end_writeback
(
inode
);
/* Cheaper version of write_inode. All changes are concealed in
* aliases, which are moved back. No write to the medium happens.
*/
/* Only deleted files may be dirty at this point */
BUG_ON
(
inode
->
i_state
&
I_DIRTY
&&
inode
->
i_nlink
);
if
(
!
block
)
return
;
if
((
logfs_super
(
sb
)
->
s_flags
&
LOGFS_SB_FLAG_SHUTDOWN
))
{
block
->
ops
->
free_block
(
inode
->
i_sb
,
block
);
return
;
}
BUG_ON
(
inode
->
i_ino
<
LOGFS_RESERVED_INOS
);
page
=
inode_to_page
(
inode
);
BUG_ON
(
!
page
);
/* FIXME: Use emergency page */
logfs_put_write_page
(
page
);
}
void
btree_write_block
(
struct
logfs_block
*
block
)
...
...
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