Commit a86bf228 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull misc vfs cleanups from Al Viro:
 "Two unrelated patches - one is a removal of long-obsolete include in
  overlayfs (it used to need fs/internal.h, but the extern it wanted has
  been moved back to include/linux/namei.h) and another introduces
  convenience helper constructing struct qstr by a NUL-terminated
  string"

* tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
  add a string-to-qstr constructor
  fs/overlayfs/namei.c: get rid of include ../internal.h
parents c270ab5a c1feab95
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -60,14 +60,14 @@ static struct inode *anon_inode_make_secure_inode(
	const struct inode *context_inode)
{
	struct inode *inode;
	const struct qstr qname = QSTR_INIT(name, strlen(name));
	int error;

	inode = alloc_anon_inode(anon_inode_mnt->mnt_sb);
	if (IS_ERR(inode))
		return inode;
	inode->i_flags &= ~S_PRIVATE;
	error =	security_inode_init_security_anon(inode, &qname, context_inode);
	error =	security_inode_init_security_anon(inode, &QSTR(name),
						  context_inode);
	if (error) {
		iput(inode);
		return ERR_PTR(error);
+1 −1
Original line number Diff line number Diff line
@@ -450,7 +450,7 @@ static int reattach_inode(struct btree_trans *trans, struct bch_inode_unpacked *
		return ret;

	struct bch_hash_info dir_hash = bch2_hash_info_init(c, &lostfound);
	struct qstr name = (struct qstr) QSTR(name_buf);
	struct qstr name = QSTR(name_buf);

	inode->bi_dir = lostfound.bi_inum;

+0 −1
Original line number Diff line number Diff line
@@ -32,7 +32,6 @@
#include <linux/sort.h>
#include <linux/stat.h>

#define QSTR(n) { { { .len = strlen(n) } }, .name = n }

int bch2_btree_lost_data(struct bch_fs *c, enum btree_id btree)
{
+0 −2
Original line number Diff line number Diff line
@@ -670,8 +670,6 @@ 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);
+1 −1
Original line number Diff line number Diff line
@@ -407,7 +407,7 @@ int erofs_getxattr(struct inode *inode, int index, const char *name,
	}

	it.index = index;
	it.name = (struct qstr)QSTR_INIT(name, strlen(name));
	it.name = QSTR(name);
	if (it.name.len > EROFS_NAME_LEN)
		return -ERANGE;

Loading