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
a0e0bda1
Commit
a0e0bda1
authored
Apr 06, 2019
by
Kent Overstreet
Committed by
Kent Overstreet
Oct 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Pass flags arg to bch2_alloc_write()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
d1170ce5
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
24 deletions
+24
-24
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_background.c
+12
-16
fs/bcachefs/alloc_background.h
fs/bcachefs/alloc_background.h
+1
-1
fs/bcachefs/ec.c
fs/bcachefs/ec.c
+2
-2
fs/bcachefs/ec.h
fs/bcachefs/ec.h
+1
-1
fs/bcachefs/super.c
fs/bcachefs/super.c
+7
-3
fs/bcachefs/sysfs.c
fs/bcachefs/sysfs.c
+1
-1
No files found.
fs/bcachefs/alloc_background.c
View file @
a0e0bda1
...
...
@@ -359,7 +359,7 @@ int bch2_alloc_replay_key(struct bch_fs *c, struct bkey_i *k)
static
int
__bch2_alloc_write_key
(
struct
btree_trans
*
trans
,
struct
bch_dev
*
ca
,
size_t
b
,
struct
btree_iter
*
iter
,
u
64
*
journal_seq
,
u
nsigned
flags
)
unsigned
flags
)
{
struct
bch_fs
*
c
=
trans
->
c
;
#if 0
...
...
@@ -397,11 +397,8 @@ static int __bch2_alloc_write_key(struct btree_trans *trans, struct bch_dev *ca,
bch2_trans_update
(
trans
,
BTREE_INSERT_ENTRY
(
iter
,
&
a
->
k_i
));
ret
=
bch2_trans_commit
(
trans
,
NULL
,
journal_seq
,
BTREE_INSERT_NOCHECK_RW
|
ret
=
bch2_trans_commit
(
trans
,
NULL
,
NULL
,
BTREE_INSERT_NOFAIL
|
BTREE_INSERT_USE_RESERVE
|
BTREE_INSERT_USE_ALLOC_RESERVE
|
BTREE_INSERT_NOMARK
|
flags
);
if
(
ret
)
...
...
@@ -417,14 +414,12 @@ static int __bch2_alloc_write_key(struct btree_trans *trans, struct bch_dev *ca,
return
0
;
}
int
bch2_alloc_write
(
struct
bch_fs
*
c
,
bool
nowait
,
bool
*
wrote
)
int
bch2_alloc_write
(
struct
bch_fs
*
c
,
unsigned
flags
,
bool
*
wrote
)
{
struct
bch_dev
*
ca
;
unsigned
i
;
int
ret
=
0
;
*
wrote
=
false
;
for_each_rw_member
(
ca
,
c
,
i
)
{
struct
btree_trans
trans
;
struct
btree_iter
*
iter
;
...
...
@@ -445,10 +440,8 @@ int bch2_alloc_write(struct bch_fs *c, bool nowait, bool *wrote)
if
(
!
buckets
->
b
[
b
].
mark
.
dirty
)
continue
;
ret
=
__bch2_alloc_write_key
(
&
trans
,
ca
,
b
,
iter
,
NULL
,
nowait
?
BTREE_INSERT_NOWAIT
:
0
);
ret
=
__bch2_alloc_write_key
(
&
trans
,
ca
,
b
,
iter
,
flags
);
if
(
ret
)
break
;
...
...
@@ -1683,7 +1676,10 @@ int bch2_fs_allocator_start(struct bch_fs *c)
* XXX: it's possible for this to deadlock waiting on journal reclaim,
* since we're holding btree writes. What then?
*/
ret
=
bch2_alloc_write
(
c
,
true
,
&
wrote
);
ret
=
bch2_alloc_write
(
c
,
BTREE_INSERT_NOCHECK_RW
|
BTREE_INSERT_USE_ALLOC_RESERVE
|
BTREE_INSERT_NOWAIT
,
&
wrote
);
/*
* If bch2_alloc_write() did anything, it may have used some
...
...
fs/bcachefs/alloc_background.h
View file @
a0e0bda1
...
...
@@ -65,7 +65,7 @@ void bch2_dev_allocator_quiesce(struct bch_fs *, struct bch_dev *);
void
bch2_dev_allocator_stop
(
struct
bch_dev
*
);
int
bch2_dev_allocator_start
(
struct
bch_dev
*
);
int
bch2_alloc_write
(
struct
bch_fs
*
,
bool
,
bool
*
);
int
bch2_alloc_write
(
struct
bch_fs
*
,
unsigned
,
bool
*
);
int
bch2_fs_allocator_start
(
struct
bch_fs
*
);
void
bch2_fs_allocator_background_init
(
struct
bch_fs
*
);
...
...
fs/bcachefs/ec.c
View file @
a0e0bda1
...
...
@@ -1194,7 +1194,7 @@ static int __bch2_stripe_write_key(struct btree_trans *trans,
BTREE_INSERT_NOFAIL
|
flags
);
}
int
bch2_stripes_write
(
struct
bch_fs
*
c
,
bool
*
wrote
)
int
bch2_stripes_write
(
struct
bch_fs
*
c
,
unsigned
flags
,
bool
*
wrote
)
{
struct
btree_trans
trans
;
struct
btree_iter
*
iter
;
...
...
@@ -1216,7 +1216,7 @@ int bch2_stripes_write(struct bch_fs *c, bool *wrote)
continue
;
ret
=
__bch2_stripe_write_key
(
&
trans
,
iter
,
m
,
giter
.
pos
,
new_key
,
BTREE_INSERT_NOCHECK_RW
);
new_key
,
flags
);
if
(
ret
)
break
;
...
...
fs/bcachefs/ec.h
View file @
a0e0bda1
...
...
@@ -151,7 +151,7 @@ void bch2_ec_stop_dev(struct bch_fs *, struct bch_dev *);
void
bch2_ec_flush_new_stripes
(
struct
bch_fs
*
);
int
bch2_stripes_read
(
struct
bch_fs
*
,
struct
list_head
*
);
int
bch2_stripes_write
(
struct
bch_fs
*
,
bool
*
);
int
bch2_stripes_write
(
struct
bch_fs
*
,
unsigned
,
bool
*
);
int
bch2_ec_mem_alloc
(
struct
bch_fs
*
,
bool
);
...
...
fs/bcachefs/super.c
View file @
a0e0bda1
...
...
@@ -196,13 +196,15 @@ static void __bch2_fs_read_only(struct bch_fs *c)
goto
allocator_not_running
;
do
{
ret
=
bch2_stripes_write
(
c
,
&
wrote
);
wrote
=
false
;
ret
=
bch2_stripes_write
(
c
,
BTREE_INSERT_NOCHECK_RW
,
&
wrote
);
if
(
ret
)
{
bch2_fs_inconsistent
(
c
,
"error writing out stripes"
);
break
;
}
ret
=
bch2_alloc_write
(
c
,
false
,
&
wrote
);
ret
=
bch2_alloc_write
(
c
,
BTREE_INSERT_NOCHECK_RW
,
&
wrote
);
if
(
ret
)
{
bch2_fs_inconsistent
(
c
,
"error writing out alloc info %i"
,
ret
);
break
;
...
...
@@ -305,7 +307,9 @@ void bch2_fs_read_only(struct bch_fs *c)
if
(
!
bch2_journal_error
(
&
c
->
journal
)
&&
!
test_bit
(
BCH_FS_ERROR
,
&
c
->
flags
)
&&
!
test_bit
(
BCH_FS_EMERGENCY_RO
,
&
c
->
flags
)
&&
test_bit
(
BCH_FS_STARTED
,
&
c
->
flags
))
test_bit
(
BCH_FS_STARTED
,
&
c
->
flags
)
&&
!
c
->
opts
.
noreplay
&&
!
c
->
opts
.
norecovery
)
bch2_fs_mark_clean
(
c
);
clear_bit
(
BCH_FS_RW
,
&
c
->
flags
);
...
...
fs/bcachefs/sysfs.c
View file @
a0e0bda1
...
...
@@ -502,7 +502,7 @@ STORE(__bch2_fs)
if
(
attr
==
&
sysfs_trigger_alloc_write
)
{
bool
wrote
;
bch2_alloc_write
(
c
,
false
,
&
wrote
);
bch2_alloc_write
(
c
,
0
,
&
wrote
);
}
if
(
attr
==
&
sysfs_prune_cache
)
{
...
...
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