qstr: constify instances in fuse
authorAl Viro <viro@zeniv.linux.org.uk>
Thu, 21 Jul 2016 02:34:44 +0000 (22:34 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Sat, 30 Jul 2016 16:25:26 +0000 (12:25 -0400)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/fuse/dir.c
fs/fuse/fuse_i.h
fs/fuse/inode.c

index 264f07c..419230a 100644 (file)
@@ -146,7 +146,7 @@ static void fuse_invalidate_entry(struct dentry *entry)
 }
 
 static void fuse_lookup_init(struct fuse_conn *fc, struct fuse_args *args,
-                            u64 nodeid, struct qstr *name,
+                            u64 nodeid, const struct qstr *name,
                             struct fuse_entry_out *outarg)
 {
        memset(outarg, 0, sizeof(struct fuse_entry_out));
@@ -282,7 +282,7 @@ int fuse_valid_type(int m)
                S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m);
 }
 
-int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
+int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name,
                     struct fuse_entry_out *outarg, struct inode **inode)
 {
        struct fuse_conn *fc = get_fuse_conn_super(sb);
index 929c383..9e42c03 100644 (file)
@@ -703,7 +703,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
                        int generation, struct fuse_attr *attr,
                        u64 attr_valid, u64 attr_version);
 
-int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
+int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name,
                     struct fuse_entry_out *outarg, struct inode **inode);
 
 /**
index 9961d84..cdc4053 100644 (file)
@@ -673,13 +673,11 @@ static struct dentry *fuse_get_dentry(struct super_block *sb,
        inode = ilookup5(sb, handle->nodeid, fuse_inode_eq, &handle->nodeid);
        if (!inode) {
                struct fuse_entry_out outarg;
-               struct qstr name;
+               const struct qstr name = QSTR_INIT(".", 1);
 
                if (!fc->export_support)
                        goto out_err;
 
-               name.len = 1;
-               name.name = ".";
                err = fuse_lookup_name(sb, handle->nodeid, &name, &outarg,
                                       &inode);
                if (err && err != -ENOENT)
@@ -775,14 +773,12 @@ static struct dentry *fuse_get_parent(struct dentry *child)
        struct inode *inode;
        struct dentry *parent;
        struct fuse_entry_out outarg;
-       struct qstr name;
+       const struct qstr name = QSTR_INIT("..", 2);
        int err;
 
        if (!fc->export_support)
                return ERR_PTR(-ESTALE);
 
-       name.len = 2;
-       name.name = "..";
        err = fuse_lookup_name(child_inode->i_sb, get_node_id(child_inode),
                               &name, &outarg, &inode);
        if (err) {