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
038fecc0
Commit
038fecc0
authored
Dec 16, 2023
by
Kent Overstreet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcachefs: qstr_eq()
Signed-off-by:
Kent Overstreet
<
kent.overstreet@linux.dev
>
parent
cf904c8d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
4 deletions
+9
-4
fs/bcachefs/dirent.c
fs/bcachefs/dirent.c
+2
-2
fs/bcachefs/fsck.c
fs/bcachefs/fsck.c
+0
-2
fs/bcachefs/util.h
fs/bcachefs/util.h
+7
-0
No files found.
fs/bcachefs/dirent.c
View file @
038fecc0
...
...
@@ -65,7 +65,7 @@ static bool dirent_cmp_key(struct bkey_s_c _l, const void *_r)
const
struct
qstr
l_name
=
bch2_dirent_get_name
(
l
);
const
struct
qstr
*
r_name
=
_r
;
return
l_name
.
len
-
r_name
->
len
?:
memcmp
(
l_name
.
name
,
r_name
->
name
,
l_name
.
len
);
return
!
qstr_eq
(
l_name
,
*
r_name
);
}
static
bool
dirent_cmp_bkey
(
struct
bkey_s_c
_l
,
struct
bkey_s_c
_r
)
...
...
@@ -75,7 +75,7 @@ static bool dirent_cmp_bkey(struct bkey_s_c _l, struct bkey_s_c _r)
const
struct
qstr
l_name
=
bch2_dirent_get_name
(
l
);
const
struct
qstr
r_name
=
bch2_dirent_get_name
(
r
);
return
l_name
.
len
-
r_name
.
len
?:
memcmp
(
l_name
.
name
,
r_name
.
name
,
l_name
.
len
);
return
!
qstr_eq
(
l_name
,
r_name
);
}
static
bool
dirent_is_visible
(
subvol_inum
inum
,
struct
bkey_s_c
k
)
...
...
fs/bcachefs/fsck.c
View file @
038fecc0
...
...
@@ -20,8 +20,6 @@
#include <linux/bsearch.h>
#include <linux/dcache.h>
/* struct qstr */
#define QSTR(n) { { { .len = strlen(n) } }, .name = n }
/*
* XXX: this is handling transaction restarts without returning
* -BCH_ERR_transaction_restart_nested, this is not how we do things anymore:
...
...
fs/bcachefs/util.h
View file @
038fecc0
...
...
@@ -856,4 +856,11 @@ static inline int cmp_le32(__le32 l, __le32 r)
#include <linux/uuid.h>
#define QSTR(n) { { { .len = strlen(n) } }, .name = n }
static
inline
bool
qstr_eq
(
const
struct
qstr
l
,
const
struct
qstr
r
)
{
return
l
.
len
==
r
.
len
&&
!
memcmp
(
l
.
name
,
r
.
name
,
l
.
len
);
}
#endif
/* _BCACHEFS_UTIL_H */
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