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
446c562c
Commit
446c562c
authored
Mar 04, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Remove direct use of bch2_btree_iter_link()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
5154704b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
19 deletions
+22
-19
fs/bcachefs/btree_iter.c
fs/bcachefs/btree_iter.c
+2
-2
fs/bcachefs/btree_iter.h
fs/bcachefs/btree_iter.h
+0
-2
fs/bcachefs/fs-io.c
fs/bcachefs/fs-io.c
+20
-15
No files found.
fs/bcachefs/btree_iter.c
View file @
446c562c
...
...
@@ -1611,7 +1611,7 @@ void __bch2_btree_iter_init(struct btree_iter *iter, struct bch_fs *c,
prefetch
(
c
->
btree_roots
[
btree_id
].
b
);
}
void
bch2_btree_iter_unlink
(
struct
btree_iter
*
iter
)
static
void
bch2_btree_iter_unlink
(
struct
btree_iter
*
iter
)
{
struct
btree_iter
*
linked
;
...
...
@@ -1630,7 +1630,7 @@ void bch2_btree_iter_unlink(struct btree_iter *iter)
BUG
();
}
void
bch2_btree_iter_link
(
struct
btree_iter
*
iter
,
struct
btree_iter
*
new
)
static
void
bch2_btree_iter_link
(
struct
btree_iter
*
iter
,
struct
btree_iter
*
new
)
{
BUG_ON
(
btree_iter_linked
(
new
));
...
...
fs/bcachefs/btree_iter.h
View file @
446c562c
...
...
@@ -164,8 +164,6 @@ static inline void bch2_btree_iter_init(struct btree_iter *iter,
?
BTREE_ITER_IS_EXTENTS
:
0
)
|
flags
);
}
void
bch2_btree_iter_link
(
struct
btree_iter
*
,
struct
btree_iter
*
);
void
bch2_btree_iter_unlink
(
struct
btree_iter
*
);
void
bch2_btree_iter_copy
(
struct
btree_iter
*
,
struct
btree_iter
*
);
static
inline
struct
bpos
btree_type_successor
(
enum
btree_id
id
,
...
...
fs/bcachefs/fs-io.c
View file @
446c562c
...
...
@@ -229,20 +229,21 @@ static void i_sectors_acct(struct bch_fs *c, struct bch_inode_info *inode,
/* normal i_size/i_sectors update machinery: */
static
s64
sum_sector_overwrites
(
struct
bkey_i
*
new
,
struct
btree_iter
*
_iter
,
bool
*
allocating
)
static
int
sum_sector_overwrites
(
struct
btree_trans
*
trans
,
struct
btree_iter
*
extent_iter
,
struct
bkey_i
*
new
,
bool
*
allocating
,
s64
*
delta
)
{
struct
btree_iter
iter
;
struct
btree_iter
*
iter
;
struct
bkey_s_c
old
;
s64
delta
=
0
;
bch2_btree_iter_init
(
&
iter
,
_iter
->
c
,
BTREE_ID_EXTENTS
,
POS_MIN
,
BTREE_ITER_SLOTS
);
*
delta
=
0
;
bch2_btree_iter_link
(
_iter
,
&
iter
);
bch2_btree_iter_copy
(
&
iter
,
_iter
);
iter
=
bch2_trans_copy_iter
(
trans
,
extent_iter
);
if
(
IS_ERR
(
iter
))
return
PTR_ERR
(
iter
);
old
=
bch2_btree_iter_peek_slot
(
&
iter
);
old
=
bch2_btree_iter_peek_slot
(
iter
);
while
(
1
)
{
/*
...
...
@@ -258,7 +259,7 @@ static s64 sum_sector_overwrites(struct bkey_i *new, struct btree_iter *_iter,
bch2_bkey_nr_dirty_ptrs
(
bkey_i_to_s_c
(
new
)))
*
allocating
=
true
;
delta
+=
(
min
(
new
->
k
.
p
.
offset
,
*
delta
+=
(
min
(
new
->
k
.
p
.
offset
,
old
.
k
->
p
.
offset
)
-
max
(
bkey_start_offset
(
&
new
->
k
),
bkey_start_offset
(
old
.
k
)))
*
...
...
@@ -268,12 +269,11 @@ static s64 sum_sector_overwrites(struct bkey_i *new, struct btree_iter *_iter,
if
(
bkey_cmp
(
old
.
k
->
p
,
new
->
k
.
p
)
>=
0
)
break
;
old
=
bch2_btree_iter_next_slot
(
&
iter
);
old
=
bch2_btree_iter_next_slot
(
iter
);
}
bch2_btree_iter_unlink
(
&
iter
);
return
delta
;
bch2_trans_iter_free
(
trans
,
iter
);
return
0
;
}
static
int
bch2_extent_update
(
struct
btree_trans
*
trans
,
...
...
@@ -303,7 +303,12 @@ static int bch2_extent_update(struct btree_trans *trans,
bch2_extent_trim_atomic
(
k
,
extent_iter
);
i_sectors_delta
=
sum_sector_overwrites
(
k
,
extent_iter
,
&
allocating
);
ret
=
sum_sector_overwrites
(
trans
,
extent_iter
,
k
,
&
allocating
,
&
i_sectors_delta
);
if
(
ret
)
return
ret
;
if
(
!
may_allocate
&&
allocating
)
return
-
ENOSPC
;
...
...
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