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
facafdcb
Commit
facafdcb
authored
Dec 20, 2022
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: Change bkey_invalid() rw param to flags
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
83f33d68
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
68 additions
and
67 deletions
+68
-67
fs/bcachefs/alloc_background.c
fs/bcachefs/alloc_background.c
+6
-5
fs/bcachefs/alloc_background.h
fs/bcachefs/alloc_background.h
+5
-5
fs/bcachefs/backpointers.c
fs/bcachefs/backpointers.c
+1
-1
fs/bcachefs/backpointers.h
fs/bcachefs/backpointers.h
+1
-1
fs/bcachefs/bkey_methods.c
fs/bcachefs/bkey_methods.c
+11
-11
fs/bcachefs/bkey_methods.h
fs/bcachefs/bkey_methods.h
+4
-4
fs/bcachefs/dirent.c
fs/bcachefs/dirent.c
+1
-1
fs/bcachefs/dirent.h
fs/bcachefs/dirent.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/extents.c
fs/bcachefs/extents.c
+6
-6
fs/bcachefs/extents.h
fs/bcachefs/extents.h
+4
-4
fs/bcachefs/inode.c
fs/bcachefs/inode.c
+4
-4
fs/bcachefs/inode.h
fs/bcachefs/inode.h
+4
-4
fs/bcachefs/lru.c
fs/bcachefs/lru.c
+1
-1
fs/bcachefs/lru.h
fs/bcachefs/lru.h
+1
-1
fs/bcachefs/quota.c
fs/bcachefs/quota.c
+1
-1
fs/bcachefs/quota.h
fs/bcachefs/quota.h
+1
-1
fs/bcachefs/reflink.c
fs/bcachefs/reflink.c
+4
-4
fs/bcachefs/reflink.h
fs/bcachefs/reflink.h
+3
-3
fs/bcachefs/subvolume.c
fs/bcachefs/subvolume.c
+2
-2
fs/bcachefs/subvolume.h
fs/bcachefs/subvolume.h
+2
-2
fs/bcachefs/xattr.c
fs/bcachefs/xattr.c
+1
-1
fs/bcachefs/xattr.h
fs/bcachefs/xattr.h
+1
-1
No files found.
fs/bcachefs/alloc_background.c
View file @
facafdcb
...
...
@@ -222,7 +222,7 @@ static unsigned bch_alloc_v1_val_u64s(const struct bch_alloc *a)
}
int
bch2_alloc_v1_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_alloc
a
=
bkey_s_c_to_alloc
(
k
);
...
...
@@ -237,7 +237,7 @@ int bch2_alloc_v1_invalid(const struct bch_fs *c, struct bkey_s_c k,
}
int
bch2_alloc_v2_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_alloc_unpacked
u
;
...
...
@@ -250,7 +250,7 @@ int bch2_alloc_v2_invalid(const struct bch_fs *c, struct bkey_s_c k,
}
int
bch2_alloc_v3_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_alloc_unpacked
u
;
...
...
@@ -263,9 +263,10 @@ int bch2_alloc_v3_invalid(const struct bch_fs *c, struct bkey_s_c k,
}
int
bch2_alloc_v4_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_alloc_v4
a
=
bkey_s_c_to_alloc_v4
(
k
);
int
rw
=
flags
&
WRITE
;
if
(
alloc_v4_u64s
(
a
.
v
)
!=
bkey_val_u64s
(
k
.
k
))
{
prt_printf
(
err
,
"bad val size (%lu != %u)"
,
...
...
@@ -620,7 +621,7 @@ static unsigned alloc_gen(struct bkey_s_c k, unsigned offset)
}
int
bch2_bucket_gens_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_val_bytes
(
k
.
k
)
!=
sizeof
(
struct
bch_bucket_gens
))
{
prt_printf
(
err
,
"bad val size (%lu != %zu)"
,
...
...
fs/bcachefs/alloc_background.h
View file @
facafdcb
...
...
@@ -122,10 +122,10 @@ struct bkey_i_alloc_v4 *bch2_alloc_to_v4_mut(struct btree_trans *, struct bkey_s
int
bch2_bucket_io_time_reset
(
struct
btree_trans
*
,
unsigned
,
size_t
,
int
);
int
bch2_alloc_v1_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_alloc_v2_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_alloc_v3_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_alloc_v4_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_alloc_v1_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
int
bch2_alloc_v2_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
int
bch2_alloc_v3_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
int
bch2_alloc_v4_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_alloc_v4_swab
(
struct
bkey_s
);
void
bch2_alloc_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
...
...
@@ -158,7 +158,7 @@ void bch2_alloc_to_text(struct printbuf *, struct bch_fs *, struct bkey_s_c);
.atomic_trigger = bch2_mark_alloc, \
})
int
bch2_bucket_gens_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_bucket_gens_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_bucket_gens_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_bucket_gens ((struct bkey_ops) { \
...
...
fs/bcachefs/backpointers.c
View file @
facafdcb
...
...
@@ -38,7 +38,7 @@ static bool extent_matches_bp(struct bch_fs *c,
}
int
bch2_backpointer_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_backpointer
bp
=
bkey_s_c_to_backpointer
(
k
);
struct
bpos
bucket
=
bp_pos_to_bucket
(
c
,
bp
.
k
->
p
);
...
...
fs/bcachefs/backpointers.h
View file @
facafdcb
...
...
@@ -8,7 +8,7 @@
#include "super.h"
int
bch2_backpointer_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
k
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_backpointer_to_text
(
struct
printbuf
*
,
const
struct
bch_backpointer
*
);
void
bch2_backpointer_k_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
void
bch2_backpointer_swab
(
struct
bkey_s
);
...
...
fs/bcachefs/bkey_methods.c
View file @
facafdcb
...
...
@@ -24,7 +24,7 @@ const char * const bch2_bkey_types[] = {
};
static
int
deleted_key_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
return
0
;
}
...
...
@@ -38,7 +38,7 @@ static int deleted_key_invalid(const struct bch_fs *c, struct bkey_s_c k,
})
static
int
empty_val_key_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_val_bytes
(
k
.
k
))
{
prt_printf
(
err
,
"incorrect value size (%zu != 0)"
,
...
...
@@ -54,7 +54,7 @@ static int empty_val_key_invalid(const struct bch_fs *c, struct bkey_s_c k,
})
static
int
key_type_cookie_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_val_bytes
(
k
.
k
)
!=
sizeof
(
struct
bch_cookie
))
{
prt_printf
(
err
,
"incorrect value size (%zu != %zu)"
,
...
...
@@ -74,7 +74,7 @@ static int key_type_cookie_invalid(const struct bch_fs *c, struct bkey_s_c k,
})
static
int
key_type_inline_data_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
return
0
;
}
...
...
@@ -95,7 +95,7 @@ static void key_type_inline_data_to_text(struct printbuf *out, struct bch_fs *c,
})
static
int
key_type_set_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_val_bytes
(
k
.
k
))
{
prt_printf
(
err
,
"incorrect value size (%zu != %zu)"
,
...
...
@@ -124,14 +124,14 @@ const struct bkey_ops bch2_bkey_ops[] = {
};
int
bch2_bkey_val_invalid
(
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
k
.
k
->
type
>=
KEY_TYPE_MAX
)
{
prt_printf
(
err
,
"invalid type (%u >= %u)"
,
k
.
k
->
type
,
KEY_TYPE_MAX
);
return
-
BCH_ERR_invalid_bkey
;
}
return
bch2_bkey_ops
[
k
.
k
->
type
].
key_invalid
(
c
,
k
,
rw
,
err
);
return
bch2_bkey_ops
[
k
.
k
->
type
].
key_invalid
(
c
,
k
,
flags
,
err
);
}
static
unsigned
bch2_key_types_allowed
[]
=
{
...
...
@@ -207,7 +207,7 @@ static unsigned bch2_key_types_allowed[] = {
int
__bch2_bkey_invalid
(
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
enum
btree_node_type
type
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
k
.
k
->
u64s
<
BKEY_U64s
)
{
prt_printf
(
err
,
"u64s too small (%u < %zu)"
,
k
.
k
->
u64s
,
BKEY_U64s
);
...
...
@@ -263,10 +263,10 @@ int __bch2_bkey_invalid(struct bch_fs *c, struct bkey_s_c k,
int
bch2_bkey_invalid
(
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
enum
btree_node_type
type
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
return
__bch2_bkey_invalid
(
c
,
k
,
type
,
rw
,
err
)
?:
bch2_bkey_val_invalid
(
c
,
k
,
rw
,
err
);
return
__bch2_bkey_invalid
(
c
,
k
,
type
,
flags
,
err
)
?:
bch2_bkey_val_invalid
(
c
,
k
,
flags
,
err
);
}
int
bch2_bkey_in_btree_node
(
struct
btree
*
b
,
struct
bkey_s_c
k
,
...
...
fs/bcachefs/bkey_methods.h
View file @
facafdcb
...
...
@@ -21,7 +21,7 @@ extern const char * const bch2_bkey_types[];
*/
struct
bkey_ops
{
int
(
*
key_invalid
)(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
);
unsigned
flags
,
struct
printbuf
*
err
);
void
(
*
val_to_text
)(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
void
(
*
swab
)(
struct
bkey_s
);
...
...
@@ -38,11 +38,11 @@ struct bkey_ops {
extern
const
struct
bkey_ops
bch2_bkey_ops
[];
int
bch2_bkey_val_invalid
(
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_bkey_val_invalid
(
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
int
__bch2_bkey_invalid
(
struct
bch_fs
*
,
struct
bkey_s_c
,
enum
btree_node_type
,
int
,
struct
printbuf
*
);
enum
btree_node_type
,
unsigned
,
struct
printbuf
*
);
int
bch2_bkey_invalid
(
struct
bch_fs
*
,
struct
bkey_s_c
,
enum
btree_node_type
,
int
,
struct
printbuf
*
);
enum
btree_node_type
,
unsigned
,
struct
printbuf
*
);
int
bch2_bkey_in_btree_node
(
struct
btree
*
,
struct
bkey_s_c
,
struct
printbuf
*
);
void
bch2_bpos_to_text
(
struct
printbuf
*
,
struct
bpos
);
...
...
fs/bcachefs/dirent.c
View file @
facafdcb
...
...
@@ -84,7 +84,7 @@ const struct bch_hash_desc bch2_dirent_hash_desc = {
};
int
bch2_dirent_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_dirent
d
=
bkey_s_c_to_dirent
(
k
);
unsigned
len
;
...
...
fs/bcachefs/dirent.h
View file @
facafdcb
...
...
@@ -6,7 +6,7 @@
extern
const
struct
bch_hash_desc
bch2_dirent_hash_desc
;
int
bch2_dirent_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_dirent_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_dirent_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_dirent ((struct bkey_ops) { \
...
...
fs/bcachefs/ec.c
View file @
facafdcb
...
...
@@ -105,7 +105,7 @@ struct ec_bio {
/* Stripes btree keys: */
int
bch2_stripe_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
const
struct
bch_stripe
*
s
=
bkey_s_c_to_stripe
(
k
).
v
;
...
...
@@ -131,7 +131,7 @@ int bch2_stripe_invalid(const struct bch_fs *c, struct bkey_s_c k,
return
-
BCH_ERR_invalid_bkey
;
}
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
rw
,
err
);
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
flags
,
err
);
}
void
bch2_stripe_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
,
...
...
fs/bcachefs/ec.h
View file @
facafdcb
...
...
@@ -7,7 +7,7 @@
#include "extents_types.h"
int
bch2_stripe_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
rw
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_stripe_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
...
...
fs/bcachefs/extents.c
View file @
facafdcb
...
...
@@ -165,7 +165,7 @@ int bch2_bkey_pick_read_device(struct bch_fs *c, struct bkey_s_c k,
/* KEY_TYPE_btree_ptr: */
int
bch2_btree_ptr_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_val_u64s
(
k
.
k
)
>
BCH_REPLICAS_MAX
)
{
prt_printf
(
err
,
"value too big (%zu > %u)"
,
...
...
@@ -173,7 +173,7 @@ int bch2_btree_ptr_invalid(const struct bch_fs *c, struct bkey_s_c k,
return
-
BCH_ERR_invalid_bkey
;
}
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
rw
,
err
);
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
flags
,
err
);
}
void
bch2_btree_ptr_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
,
...
...
@@ -183,7 +183,7 @@ void bch2_btree_ptr_to_text(struct printbuf *out, struct bch_fs *c,
}
int
bch2_btree_ptr_v2_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_btree_ptr_v2
bp
=
bkey_s_c_to_btree_ptr_v2
(
k
);
...
...
@@ -206,7 +206,7 @@ int bch2_btree_ptr_v2_invalid(const struct bch_fs *c, struct bkey_s_c k,
return
-
BCH_ERR_invalid_bkey
;
}
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
rw
,
err
);
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
flags
,
err
);
}
void
bch2_btree_ptr_v2_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
,
...
...
@@ -388,7 +388,7 @@ bool bch2_extent_merge(struct bch_fs *c, struct bkey_s l, struct bkey_s_c r)
/* KEY_TYPE_reservation: */
int
bch2_reservation_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_reservation
r
=
bkey_s_c_to_reservation
(
k
);
...
...
@@ -1085,7 +1085,7 @@ static int extent_ptr_invalid(const struct bch_fs *c,
}
int
bch2_bkey_ptrs_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_ptrs_c
ptrs
=
bch2_bkey_ptrs_c
(
k
);
const
union
bch_extent_entry
*
entry
;
...
...
fs/bcachefs/extents.h
View file @
facafdcb
...
...
@@ -371,11 +371,11 @@ int bch2_bkey_pick_read_device(struct bch_fs *, struct bkey_s_c,
/* KEY_TYPE_btree_ptr: */
int
bch2_btree_ptr_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_btree_ptr_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_btree_ptr_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
int
bch2_btree_ptr_v2_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_btree_ptr_v2_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_btree_ptr_v2_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
void
bch2_btree_ptr_v2_compat
(
enum
btree_id
,
unsigned
,
unsigned
,
int
,
struct
bkey_s
);
...
...
@@ -414,7 +414,7 @@ bool bch2_extent_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
/* KEY_TYPE_reservation: */
int
bch2_reservation_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_reservation_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
bool
bch2_reservation_merge
(
struct
bch_fs
*
,
struct
bkey_s
,
struct
bkey_s_c
);
...
...
@@ -659,7 +659,7 @@ bool bch2_extent_normalize(struct bch_fs *, struct bkey_s);
void
bch2_bkey_ptrs_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
int
bch2_bkey_ptrs_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_ptr_swab
(
struct
bkey_s
);
...
...
fs/bcachefs/inode.c
View file @
facafdcb
...
...
@@ -433,7 +433,7 @@ static int __bch2_inode_invalid(struct bkey_s_c k, struct printbuf *err)
}
int
bch2_inode_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_inode
inode
=
bkey_s_c_to_inode
(
k
);
...
...
@@ -453,7 +453,7 @@ int bch2_inode_invalid(const struct bch_fs *c, struct bkey_s_c k,
}
int
bch2_inode_v2_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_inode_v2
inode
=
bkey_s_c_to_inode_v2
(
k
);
...
...
@@ -473,7 +473,7 @@ int bch2_inode_v2_invalid(const struct bch_fs *c, struct bkey_s_c k,
}
int
bch2_inode_v3_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_inode_v3
inode
=
bkey_s_c_to_inode_v3
(
k
);
...
...
@@ -536,7 +536,7 @@ void bch2_inode_to_text(struct printbuf *out, struct bch_fs *c, struct bkey_s_c
}
int
bch2_inode_generation_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
k
.
k
->
p
.
inode
)
{
prt_printf
(
err
,
"nonzero k.p.inode"
);
...
...
fs/bcachefs/inode.h
View file @
facafdcb
...
...
@@ -7,9 +7,9 @@
extern
const
char
*
const
bch2_inode_opts
[];
int
bch2_inode_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_inode_v2_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_inode_v3_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_inode_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
int
bch2_inode_v2_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
int
bch2_inode_v3_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_inode_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_inode ((struct bkey_ops) { \
...
...
@@ -41,7 +41,7 @@ static inline bool bkey_is_inode(const struct bkey *k)
}
int
bch2_inode_generation_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_inode_generation_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_inode_generation ((struct bkey_ops) { \
...
...
fs/bcachefs/lru.c
View file @
facafdcb
...
...
@@ -10,7 +10,7 @@
/* KEY_TYPE_lru is obsolete: */
int
bch2_lru_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
const
struct
bch_lru
*
lru
=
bkey_s_c_to_lru
(
k
).
v
;
...
...
fs/bcachefs/lru.h
View file @
facafdcb
...
...
@@ -22,7 +22,7 @@ static inline u64 lru_pos_time(struct bpos pos)
return
pos
.
inode
&
~
(
~
0ULL
<<
LRU_TIME_BITS
);
}
int
bch2_lru_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_lru_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_lru_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_lru ((struct bkey_ops) { \
...
...
fs/bcachefs/quota.c
View file @
facafdcb
...
...
@@ -59,7 +59,7 @@ const struct bch_sb_field_ops bch_sb_field_ops_quota = {
};
int
bch2_quota_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
k
.
k
->
p
.
inode
>=
QTYP_NR
)
{
prt_printf
(
err
,
"invalid quota type (%llu >= %u)"
,
...
...
fs/bcachefs/quota.h
View file @
facafdcb
...
...
@@ -7,7 +7,7 @@
extern
const
struct
bch_sb_field_ops
bch_sb_field_ops_quota
;
int
bch2_quota_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_quota_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_quota_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_quota ((struct bkey_ops) { \
...
...
fs/bcachefs/reflink.c
View file @
facafdcb
...
...
@@ -26,7 +26,7 @@ static inline unsigned bkey_type_to_indirect(const struct bkey *k)
/* reflink pointers */
int
bch2_reflink_p_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_reflink_p
p
=
bkey_s_c_to_reflink_p
(
k
);
...
...
@@ -78,7 +78,7 @@ bool bch2_reflink_p_merge(struct bch_fs *c, struct bkey_s _l, struct bkey_s_c _r
/* indirect extents */
int
bch2_reflink_v_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_reflink_v
r
=
bkey_s_c_to_reflink_v
(
k
);
...
...
@@ -88,7 +88,7 @@ int bch2_reflink_v_invalid(const struct bch_fs *c, struct bkey_s_c k,
return
-
BCH_ERR_invalid_bkey
;
}
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
rw
,
err
);
return
bch2_bkey_ptrs_invalid
(
c
,
k
,
flags
,
err
);
}
void
bch2_reflink_v_to_text
(
struct
printbuf
*
out
,
struct
bch_fs
*
c
,
...
...
@@ -131,7 +131,7 @@ int bch2_trans_mark_reflink_v(struct btree_trans *trans,
/* indirect inline data */
int
bch2_indirect_inline_data_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_val_bytes
(
k
.
k
)
<
sizeof
(
struct
bch_indirect_inline_data
))
{
prt_printf
(
err
,
"incorrect value size (%zu < %zu)"
,
...
...
fs/bcachefs/reflink.h
View file @
facafdcb
...
...
@@ -3,7 +3,7 @@
#define _BCACHEFS_REFLINK_H
int
bch2_reflink_p_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_reflink_p_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
bool
bch2_reflink_p_merge
(
struct
bch_fs
*
,
struct
bkey_s
,
struct
bkey_s_c
);
...
...
@@ -17,7 +17,7 @@ bool bch2_reflink_p_merge(struct bch_fs *, struct bkey_s, struct bkey_s_c);
})
int
bch2_reflink_v_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_reflink_v_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
int
bch2_trans_mark_reflink_v
(
struct
btree_trans
*
,
enum
btree_id
,
unsigned
,
...
...
@@ -32,7 +32,7 @@ int bch2_trans_mark_reflink_v(struct btree_trans *, enum btree_id, unsigned,
})
int
bch2_indirect_inline_data_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_indirect_inline_data_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
int
bch2_trans_mark_indirect_inline_data
(
struct
btree_trans
*
,
...
...
fs/bcachefs/subvolume.c
View file @
facafdcb
...
...
@@ -25,7 +25,7 @@ void bch2_snapshot_to_text(struct printbuf *out, struct bch_fs *c,
}
int
bch2_snapshot_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
struct
bkey_s_c_snapshot
s
;
u32
i
,
id
;
...
...
@@ -733,7 +733,7 @@ static int bch2_delete_dead_snapshots_hook(struct btree_trans *trans,
/* Subvolumes: */
int
bch2_subvolume_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
if
(
bkey_lt
(
k
.
k
->
p
,
SUBVOL_POS_MIN
)
||
bkey_gt
(
k
.
k
->
p
,
SUBVOL_POS_MAX
))
{
...
...
fs/bcachefs/subvolume.h
View file @
facafdcb
...
...
@@ -7,7 +7,7 @@
void
bch2_snapshot_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
int
bch2_snapshot_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
rw
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
#define bch2_bkey_ops_snapshot ((struct bkey_ops) { \
.key_invalid = bch2_snapshot_invalid, \
...
...
@@ -106,7 +106,7 @@ void bch2_fs_snapshots_exit(struct bch_fs *);
int
bch2_fs_snapshots_start
(
struct
bch_fs
*
);
int
bch2_subvolume_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
rw
,
struct
printbuf
*
);
unsigned
,
struct
printbuf
*
);
void
bch2_subvolume_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_subvolume ((struct bkey_ops) { \
...
...
fs/bcachefs/xattr.c
View file @
facafdcb
...
...
@@ -70,7 +70,7 @@ const struct bch_hash_desc bch2_xattr_hash_desc = {
};
int
bch2_xattr_invalid
(
const
struct
bch_fs
*
c
,
struct
bkey_s_c
k
,
int
rw
,
struct
printbuf
*
err
)
unsigned
flags
,
struct
printbuf
*
err
)
{
const
struct
xattr_handler
*
handler
;
struct
bkey_s_c_xattr
xattr
=
bkey_s_c_to_xattr
(
k
);
...
...
fs/bcachefs/xattr.h
View file @
facafdcb
...
...
@@ -6,7 +6,7 @@
extern
const
struct
bch_hash_desc
bch2_xattr_hash_desc
;
int
bch2_xattr_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
int
,
struct
printbuf
*
);
int
bch2_xattr_invalid
(
const
struct
bch_fs
*
,
struct
bkey_s_c
,
unsigned
,
struct
printbuf
*
);
void
bch2_xattr_to_text
(
struct
printbuf
*
,
struct
bch_fs
*
,
struct
bkey_s_c
);
#define bch2_bkey_ops_xattr ((struct bkey_ops) { \
...
...
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