spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
}
- if (dentry->d_name.len != lower_dentry->d_name.len) {
- __d_drop(dentry);
- err = 0;
- } else if (strncasecmp(dentry->d_name.name, lower_dentry->d_name.name,
- dentry->d_name.len) != 0) {
+ if (!qstr_case_eq(&dentry->d_name, &lower_dentry->d_name)) {
__d_drop(dentry);
err = 0;
}
}
*/
if (name->len == len) {
- if (strncasecmp(name->name, str, len) == 0)
+ if (str_n_case_eq(name->name, str, len))
return 0;
}
return 1;
if (needs_fixup(info->perm)) {
list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) {
spin_lock_nested(&child->d_lock, depth + 1);
- if (!(limit->flags & BY_NAME) || !strncasecmp(child->d_name.name, limit->name, limit->length)) {
+ if (!(limit->flags & BY_NAME) || qstr_case_eq(&child->d_name, &limit->name)) {
if (child->d_inode) {
get_derived_permission(dentry, child);
fixup_tmp_permissions(child->d_inode);
struct sdcardfs_sb_info *sbinfo;
struct limit_search limit = {
.flags = BY_NAME,
- .name = key->name,
- .length = key->len,
+ .name = QSTR_INIT(key->name, key->len),
};
list_for_each_entry(sbinfo, &sdcardfs_super_list, list) {
if (sbinfo_has_sdcard_magic(sbinfo))
struct sdcardfs_sb_info *sbinfo;
struct limit_search limit = {
.flags = BY_NAME | BY_USERID,
- .name = key->name,
- .length = key->len,
+ .name = QSTR_INIT(key->name, key->len),
.userid = userid,
};
list_for_each_entry(sbinfo, &sdcardfs_super_list, list) {
#define BY_USERID (1 << 1)
struct limit_search {
unsigned int flags;
- const char *name;
- size_t length;
+ struct qstr name;
userid_t userid;
};
return !strcasecmp(s1, s2);
}
+static inline bool str_n_case_eq(const char *s1, const char *s2, size_t len) {
+ return !strncasecmp(s1, s2, len);
+}
+
static inline bool qstr_case_eq(const struct qstr *q1, const struct qstr *q2)
{
return q1->len == q2->len && str_case_eq(q1->name, q2->name);