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
06a2f9fa
Commit
06a2f9fa
authored
Apr 28, 2007
by
Chris Mason
Committed by
David Woodhouse
Apr 28, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Btrfs: try to drop dead cow pages from ram
Signed-off-by:
Chris Mason
<
chris.mason@oracle.com
>
parent
28b8bb9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
fs/btrfs/TODO
fs/btrfs/TODO
+1
-2
fs/btrfs/extent-tree.c
fs/btrfs/extent-tree.c
+17
-0
No files found.
fs/btrfs/TODO
View file @
06a2f9fa
...
...
@@ -6,8 +6,7 @@
* Check compat and incompat flags on the inode
* Get rid of struct ctree_path, limiting tree levels held at one time
* Add generation number to key pointer in nodes
* Add parent pointer back to extent map.
* Implement real list of pending transactions
* Add generation number to inode
* Release
* Do real tree locking
* Add extent mirroring (backup copies of blocks)
...
...
fs/btrfs/extent-tree.c
View file @
06a2f9fa
...
...
@@ -291,10 +291,18 @@ static int update_block_group(struct btrfs_trans_handle *trans,
return
0
;
}
static
int
try_remove_page
(
struct
address_space
*
mapping
,
unsigned
long
index
)
{
int
ret
;
ret
=
invalidate_mapping_pages
(
mapping
,
index
,
index
);
return
ret
;
}
int
btrfs_finish_extent_commit
(
struct
btrfs_trans_handle
*
trans
,
struct
btrfs_root
*
root
)
{
unsigned
long
gang
[
8
];
struct
inode
*
btree_inode
=
root
->
fs_info
->
btree_inode
;
u64
first
=
0
;
int
ret
;
int
i
;
...
...
@@ -309,6 +317,9 @@ int btrfs_finish_extent_commit(struct btrfs_trans_handle *trans, struct
first
=
gang
[
0
];
for
(
i
=
0
;
i
<
ret
;
i
++
)
{
clear_radix_bit
(
pinned_radix
,
gang
[
i
]);
try_remove_page
(
btree_inode
->
i_mapping
,
gang
[
i
]
<<
(
PAGE_CACHE_SHIFT
-
btree_inode
->
i_blkbits
));
}
}
if
(
root
->
fs_info
->
block_group_cache
)
{
...
...
@@ -600,6 +611,12 @@ static int find_free_extent(struct btrfs_trans_handle *trans, struct btrfs_root
*/
btrfs_release_path
(
root
,
path
);
BUG_ON
(
ins
->
objectid
<
search_start
);
if
(
ins
->
objectid
>=
btrfs_super_total_blocks
(
info
->
disk_super
))
{
if
(
search_start
==
0
)
return
-
ENOSPC
;
search_start
=
0
;
goto
check_failed
;
}
for
(
test_block
=
ins
->
objectid
;
test_block
<
ins
->
objectid
+
num_blocks
;
test_block
++
)
{
if
(
test_radix_bit
(
&
info
->
pinned_radix
,
test_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