From 4f3ccd76572a83278166c12f3e351e74cc03578c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:06:15 -0400 Subject: qstr: constify dentry_init_security Signed-off-by: Al Viro diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h index 7ae3976..101bf19 100644 --- a/include/linux/lsm_hooks.h +++ b/include/linux/lsm_hooks.h @@ -1356,7 +1356,7 @@ union security_list_options { struct super_block *newsb); int (*sb_parse_opts_str)(char *options, struct security_mnt_opts *opts); int (*dentry_init_security)(struct dentry *dentry, int mode, - struct qstr *name, void **ctx, + const struct qstr *name, void **ctx, u32 *ctxlen); diff --git a/include/linux/security.h b/include/linux/security.h index 14df373..7831cd5 100644 --- a/include/linux/security.h +++ b/include/linux/security.h @@ -240,7 +240,7 @@ int security_sb_clone_mnt_opts(const struct super_block *oldsb, struct super_block *newsb); int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); int security_dentry_init_security(struct dentry *dentry, int mode, - struct qstr *name, void **ctx, + const struct qstr *name, void **ctx, u32 *ctxlen); int security_inode_alloc(struct inode *inode); @@ -591,7 +591,7 @@ static inline void security_inode_free(struct inode *inode) static inline int security_dentry_init_security(struct dentry *dentry, int mode, - struct qstr *name, + const struct qstr *name, void **ctx, u32 *ctxlen) { diff --git a/security/security.c b/security/security.c index 7095693..d441f45 100644 --- a/security/security.c +++ b/security/security.c @@ -356,7 +356,7 @@ void security_inode_free(struct inode *inode) } int security_dentry_init_security(struct dentry *dentry, int mode, - struct qstr *name, void **ctx, + const struct qstr *name, void **ctx, u32 *ctxlen) { return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode, diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index a86d537..22b6628 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -2809,7 +2809,7 @@ static void selinux_inode_free_security(struct inode *inode) } static int selinux_dentry_init_security(struct dentry *dentry, int mode, - struct qstr *name, void **ctx, + const struct qstr *name, void **ctx, u32 *ctxlen) { u32 newsid; -- cgit v0.10.2 From 7f5458ec5c13b4489eff220b6429e571e2140aa6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:11:45 -0400 Subject: qstr: constify instances in logfs Signed-off-by: Al Viro diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c index 2d5336b..438b7c5 100644 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c @@ -156,7 +156,7 @@ static pgoff_t hash_index(u32 hash, int round) static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry) { - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; struct page *page; struct logfs_disk_dentry *dd; u32 hash = hash_32(name->name, name->len, 0); @@ -323,7 +323,7 @@ static int logfs_readdir(struct file *file, struct dir_context *ctx) return 0; } -static void logfs_set_name(struct logfs_disk_dentry *dd, struct qstr *name) +static void logfs_set_name(struct logfs_disk_dentry *dd, const struct qstr *name) { dd->namelen = cpu_to_be16(name->len); memcpy(dd->name, name->name, name->len); -- cgit v0.10.2 From b5cce521e849c998e169820c734731a468fcf2b4 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:17:26 -0400 Subject: qstr: constify instances in hfsplus Signed-off-by: Al Viro diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c index fb707e8..142534d 100644 --- a/fs/hfsplus/catalog.c +++ b/fs/hfsplus/catalog.c @@ -40,7 +40,7 @@ int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1, /* Generates key for catalog file/folders record. */ int hfsplus_cat_build_key(struct super_block *sb, - hfsplus_btree_key *key, u32 parent, struct qstr *str) + hfsplus_btree_key *key, u32 parent, const struct qstr *str) { int len, err; @@ -174,7 +174,7 @@ static int hfsplus_cat_build_record(hfsplus_cat_entry *entry, static int hfsplus_fill_cat_thread(struct super_block *sb, hfsplus_cat_entry *entry, int type, - u32 parentid, struct qstr *str) + u32 parentid, const struct qstr *str) { int err; @@ -250,7 +250,7 @@ static void hfsplus_subfolders_dec(struct inode *dir) } int hfsplus_create_cat(u32 cnid, struct inode *dir, - struct qstr *str, struct inode *inode) + const struct qstr *str, struct inode *inode) { struct super_block *sb = dir->i_sb; struct hfs_find_data fd; @@ -318,7 +318,7 @@ err2: return err; } -int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str) +int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str) { struct super_block *sb = dir->i_sb; struct hfs_find_data fd; @@ -415,8 +415,8 @@ out: } int hfsplus_rename_cat(u32 cnid, - struct inode *src_dir, struct qstr *src_name, - struct inode *dst_dir, struct qstr *dst_name) + struct inode *src_dir, const struct qstr *src_name, + struct inode *dst_dir, const struct qstr *dst_name) { struct super_block *sb = src_dir->i_sb; struct hfs_find_data src_fd, dst_fd; diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h index fdc3446..9ed1d9b 100644 --- a/fs/hfsplus/hfsplus_fs.h +++ b/fs/hfsplus/hfsplus_fs.h @@ -445,17 +445,17 @@ int hfsplus_cat_case_cmp_key(const hfsplus_btree_key *k1, int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1, const hfsplus_btree_key *k2); int hfsplus_cat_build_key(struct super_block *sb, hfsplus_btree_key *key, - u32 parent, struct qstr *str); + u32 parent, const struct qstr *str); void hfsplus_cat_build_key_with_cnid(struct super_block *sb, hfsplus_btree_key *key, u32 parent); void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms); int hfsplus_find_cat(struct super_block *sb, u32 cnid, struct hfs_find_data *fd); -int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str, +int hfsplus_create_cat(u32 cnid, struct inode *dir, const struct qstr *str, struct inode *inode); -int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str); -int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, struct qstr *src_name, - struct inode *dst_dir, struct qstr *dst_name); +int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str); +int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, const struct qstr *src_name, + struct inode *dst_dir, const struct qstr *dst_name); /* dir.c */ extern const struct inode_operations hfsplus_dir_inode_operations; -- cgit v0.10.2 From 71e939634de7ed6aad2978b55d131ec6f1f9aaa6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:22:29 -0400 Subject: qstr: constify instances in hfs Signed-off-by: Al Viro diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c index 98cde8b..8f4afd3 100644 --- a/fs/hfs/catalog.c +++ b/fs/hfs/catalog.c @@ -20,7 +20,7 @@ * * Given the ID of the parent and the name build a search key. */ -void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, struct qstr *name) +void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, const struct qstr *name) { key->cat.reserved = 0; key->cat.ParID = cpu_to_be32(parent); @@ -64,7 +64,7 @@ static int hfs_cat_build_record(hfs_cat_rec *rec, u32 cnid, struct inode *inode) static int hfs_cat_build_thread(struct super_block *sb, hfs_cat_rec *rec, int type, - u32 parentid, struct qstr *name) + u32 parentid, const struct qstr *name) { rec->type = type; memset(rec->thread.reserved, 0, sizeof(rec->thread.reserved)); @@ -79,7 +79,7 @@ static int hfs_cat_build_thread(struct super_block *sb, * Add a new file or directory to the catalog B-tree and * return a (struct hfs_cat_entry) for it in '*result'. */ -int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *inode) +int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct inode *inode) { struct hfs_find_data fd; struct super_block *sb; @@ -210,7 +210,7 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid, * Delete the indicated file or directory. * The associated thread is also removed unless ('with_thread'==0). */ -int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str) +int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str) { struct super_block *sb; struct hfs_find_data fd; @@ -277,8 +277,8 @@ out: * If the destination exists it is removed and a * (struct hfs_cat_entry) for it is returned in '*result'. */ -int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name, - struct inode *dst_dir, struct qstr *dst_name) +int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name, + struct inode *dst_dir, const struct qstr *dst_name) { struct super_block *sb; struct hfs_find_data src_fd, dst_fd; diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h index ee2f385..e799ebe 100644 --- a/fs/hfs/hfs_fs.h +++ b/fs/hfs/hfs_fs.h @@ -178,11 +178,11 @@ extern int hfs_clear_vbm_bits(struct super_block *, u16, u16); extern int hfs_cat_keycmp(const btree_key *, const btree_key *); struct hfs_find_data; extern int hfs_cat_find_brec(struct super_block *, u32, struct hfs_find_data *); -extern int hfs_cat_create(u32, struct inode *, struct qstr *, struct inode *); -extern int hfs_cat_delete(u32, struct inode *, struct qstr *); -extern int hfs_cat_move(u32, struct inode *, struct qstr *, - struct inode *, struct qstr *); -extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *); +extern int hfs_cat_create(u32, struct inode *, const struct qstr *, struct inode *); +extern int hfs_cat_delete(u32, struct inode *, const struct qstr *); +extern int hfs_cat_move(u32, struct inode *, const struct qstr *, + struct inode *, const struct qstr *); +extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, const struct qstr *); /* dir.c */ extern const struct file_operations hfs_dir_operations; @@ -201,7 +201,7 @@ extern int hfs_get_block(struct inode *, sector_t, struct buffer_head *, int); extern const struct address_space_operations hfs_aops; extern const struct address_space_operations hfs_btree_aops; -extern struct inode *hfs_new_inode(struct inode *, struct qstr *, umode_t); +extern struct inode *hfs_new_inode(struct inode *, const struct qstr *, umode_t); extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *); extern int hfs_write_inode(struct inode *, struct writeback_control *); extern int hfs_inode_setattr(struct dentry *, struct iattr *); @@ -237,7 +237,7 @@ extern int hfs_compare_dentry(const struct dentry *parent, const struct dentry * unsigned int len, const char *str, const struct qstr *name); /* trans.c */ -extern void hfs_asc2mac(struct super_block *, struct hfs_name *, struct qstr *); +extern void hfs_asc2mac(struct super_block *, struct hfs_name *, const struct qstr *); extern int hfs_mac2asc(struct super_block *, char *, const struct hfs_name *); /* super.c */ diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c index 8eed66a..6d6affd 100644 --- a/fs/hfs/inode.c +++ b/fs/hfs/inode.c @@ -177,7 +177,7 @@ const struct address_space_operations hfs_aops = { /* * hfs_new_inode */ -struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode) +struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t mode) { struct super_block *sb = dir->i_sb; struct inode *inode = new_inode(sb); diff --git a/fs/hfs/trans.c b/fs/hfs/trans.c index b1ce4c7..39f5e34 100644 --- a/fs/hfs/trans.c +++ b/fs/hfs/trans.c @@ -94,7 +94,7 @@ out: * This routine is a inverse to hfs_mac2triv(). * A ':' is replaced by a '/'. */ -void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, struct qstr *in) +void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, const struct qstr *in) { struct nls_table *nls_disk = HFS_SB(sb)->nls_disk; struct nls_table *nls_io = HFS_SB(sb)->nls_io; -- cgit v0.10.2 From 8ac790f312c47bb378fb129d3832d401945a0ca3 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:25:07 -0400 Subject: qstr: constify instances in autofs4 Signed-off-by: Al Viro diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 3767f66..fa84bb8 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -159,7 +159,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry) { struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); struct dentry *parent = dentry->d_parent; - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; unsigned int len = name->len; unsigned int hash = name->hash; const unsigned char *str = name->name; @@ -172,7 +172,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry) list_for_each(p, head) { struct autofs_info *ino; struct dentry *active; - struct qstr *qstr; + const struct qstr *qstr; ino = list_entry(p, struct autofs_info, active); active = ino->dentry; @@ -214,7 +214,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry, { struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); struct dentry *parent = dentry->d_parent; - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; unsigned int len = name->len; unsigned int hash = name->hash; const unsigned char *str = name->name; @@ -227,7 +227,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry, list_for_each(p, head) { struct autofs_info *ino; struct dentry *expiring; - struct qstr *qstr; + const struct qstr *qstr; if (rcu_walk) { spin_unlock(&sbi->lookup_lock); diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 631f155..432b0d5 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c @@ -225,7 +225,7 @@ rename_retry: } static struct autofs_wait_queue * -autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr) +autofs4_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr) { struct autofs_wait_queue *wq; @@ -249,7 +249,7 @@ autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr) */ static int validate_request(struct autofs_wait_queue **wait, struct autofs_sb_info *sbi, - struct qstr *qstr, + const struct qstr *qstr, struct dentry *dentry, enum autofs_notify notify) { struct autofs_wait_queue *wq; -- cgit v0.10.2 From 612645f7cfe1221f8066b87d62089719bcf43f68 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:27:42 -0400 Subject: qstr: constify instances in ocfs2 Signed-off-by: Al Viro diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c index 12e064b..533bd52 100644 --- a/fs/ocfs2/dlm/dlmdomain.c +++ b/fs/ocfs2/dlm/dlmdomain.c @@ -172,12 +172,10 @@ void __dlm_unhash_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) void __dlm_insert_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) { struct hlist_head *bucket; - struct qstr *q; assert_spin_locked(&dlm->spinlock); - q = &res->lockname; - bucket = dlm_lockres_hash(dlm, q->hash); + bucket = dlm_lockres_hash(dlm, res->lockname.hash); /* get a reference for our hashtable */ dlm_lockres_get(res); diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c index 47b3b2d..ef474cd 100644 --- a/fs/ocfs2/dlmfs/dlmfs.c +++ b/fs/ocfs2/dlmfs/dlmfs.c @@ -469,7 +469,7 @@ static int dlmfs_mkdir(struct inode * dir, { int status; struct inode *inode = NULL; - struct qstr *domain = &dentry->d_name; + const struct qstr *domain = &dentry->d_name; struct dlmfs_inode_private *ip; struct ocfs2_cluster_connection *conn; @@ -518,7 +518,7 @@ static int dlmfs_create(struct inode *dir, { int status = 0; struct inode *inode; - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; mlog(0, "create %.*s\n", name->len, name->name); diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c index 0499e3f..f70cda2 100644 --- a/fs/ocfs2/dlmfs/userdlm.c +++ b/fs/ocfs2/dlmfs/userdlm.c @@ -667,7 +667,7 @@ void user_dlm_set_locking_protocol(void) ocfs2_stack_glue_set_max_proto_version(&user_dlm_lproto.lp_max_version); } -struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name) +struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name) { int rc; struct ocfs2_cluster_connection *conn; diff --git a/fs/ocfs2/dlmfs/userdlm.h b/fs/ocfs2/dlmfs/userdlm.h index 3b42d79..ede94a6 100644 --- a/fs/ocfs2/dlmfs/userdlm.h +++ b/fs/ocfs2/dlmfs/userdlm.h @@ -83,7 +83,7 @@ void user_dlm_write_lvb(struct inode *inode, ssize_t user_dlm_read_lvb(struct inode *inode, char *val, unsigned int len); -struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name); +struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name); void user_dlm_unregister(struct ocfs2_cluster_connection *conn); void user_dlm_set_locking_protocol(void); -- cgit v0.10.2 From beffb8feb6e26851165ee927e0eb963d6db334b0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 16:34:42 -0400 Subject: qstr: constify instances in nfs Signed-off-by: Al Viro diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c index cb28ccee..698be93 100644 --- a/fs/nfs/nfs3proc.c +++ b/fs/nfs/nfs3proc.c @@ -144,7 +144,7 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, } static int -nfs3_proc_lookup(struct inode *dir, struct qstr *name, +nfs3_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label) { @@ -404,7 +404,7 @@ out: } static int -nfs3_proc_remove(struct inode *dir, struct qstr *name) +nfs3_proc_remove(struct inode *dir, const struct qstr *name) { struct nfs_removeargs arg = { .fh = NFS_FH(dir), @@ -480,7 +480,7 @@ nfs3_proc_rename_done(struct rpc_task *task, struct inode *old_dir, } static int -nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) +nfs3_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name) { struct nfs3_linkargs arg = { .fromfh = NFS_FH(inode), @@ -582,7 +582,7 @@ out: } static int -nfs3_proc_rmdir(struct inode *dir, struct qstr *name) +nfs3_proc_rmdir(struct inode *dir, const struct qstr *name) { struct nfs_fattr *dir_attr; struct nfs3_diropargs arg = { diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h index 768456f..81e9385 100644 --- a/fs/nfs/nfs4_fs.h +++ b/fs/nfs/nfs4_fs.h @@ -224,7 +224,8 @@ int nfs_atomic_open(struct inode *, struct dentry *, struct file *, extern struct file_system_type nfs4_fs_type; /* nfs4namespace.c */ -struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, struct qstr *); +struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, + const struct qstr *); struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *, struct nfs_fh *, struct nfs_fattr *); int nfs4_replace_transport(struct nfs_server *server, @@ -251,7 +252,7 @@ extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struc extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, struct page *page, struct rpc_cred *); extern int nfs4_proc_fsid_present(struct inode *, struct rpc_cred *); -extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, struct qstr *, +extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, const struct qstr *, struct nfs_fh *, struct nfs_fattr *); extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); extern const struct xattr_handler *nfs4_xattr_handlers[]; diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index f592672..d211049 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -208,7 +208,7 @@ static struct rpc_clnt *nfs_find_best_sec(struct rpc_clnt *clnt, */ struct rpc_clnt * nfs4_negotiate_security(struct rpc_clnt *clnt, struct inode *inode, - struct qstr *name) + const struct qstr *name) { struct page *page; struct nfs4_secinfo_flavors *flavors; @@ -397,7 +397,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry, rpc_authflavor_t flavor = server->client->cl_auth->au_flavor; struct dentry *parent = dget_parent(dentry); struct inode *dir = d_inode(parent); - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; struct rpc_clnt *client; struct vfsmount *mnt; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index ff416d0..e75815c 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -3530,7 +3530,7 @@ static void nfs_fixup_secinfo_attributes(struct nfs_fattr *fattr) } static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir, - struct qstr *name, struct nfs_fh *fhandle, + const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label) { struct nfs4_exception exception = { }; @@ -3572,7 +3572,7 @@ out: return err; } -static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, +static int nfs4_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label) { @@ -3588,7 +3588,7 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, } struct rpc_clnt * -nfs4_proc_lookup_mountpoint(struct inode *dir, struct qstr *name, +nfs4_proc_lookup_mountpoint(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr) { struct rpc_clnt *client = NFS_CLIENT(dir); @@ -3747,7 +3747,7 @@ out: return status; } -static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) +static int _nfs4_proc_remove(struct inode *dir, const struct qstr *name) { struct nfs_server *server = NFS_SERVER(dir); struct nfs_removeargs args = { @@ -3770,7 +3770,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) return status; } -static int nfs4_proc_remove(struct inode *dir, struct qstr *name) +static int nfs4_proc_remove(struct inode *dir, const struct qstr *name) { struct nfs4_exception exception = { }; int err; @@ -3853,7 +3853,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, return 1; } -static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) +static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name) { struct nfs_server *server = NFS_SERVER(inode); struct nfs4_link_arg arg = { @@ -3900,7 +3900,7 @@ out: return status; } -static int nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) +static int nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name) { struct nfs4_exception exception = { }; int err; @@ -3922,7 +3922,7 @@ struct nfs4_createdata { }; static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, - struct qstr *name, struct iattr *sattr, u32 ftype) + const struct qstr *name, struct iattr *sattr, u32 ftype) { struct nfs4_createdata *data; diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c index b417bbc..b7bca83 100644 --- a/fs/nfs/proc.c +++ b/fs/nfs/proc.c @@ -145,7 +145,7 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, } static int -nfs_proc_lookup(struct inode *dir, struct qstr *name, +nfs_proc_lookup(struct inode *dir, const struct qstr *name, struct nfs_fh *fhandle, struct nfs_fattr *fattr, struct nfs4_label *label) { @@ -299,7 +299,7 @@ out: } static int -nfs_proc_remove(struct inode *dir, struct qstr *name) +nfs_proc_remove(struct inode *dir, const struct qstr *name) { struct nfs_removeargs arg = { .fh = NFS_FH(dir), @@ -357,7 +357,7 @@ nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir, } static int -nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) +nfs_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name) { struct nfs_linkargs arg = { .fromfh = NFS_FH(inode), @@ -456,7 +456,7 @@ out: } static int -nfs_proc_rmdir(struct inode *dir, struct qstr *name) +nfs_proc_rmdir(struct inode *dir, const struct qstr *name) { struct nfs_diropargs arg = { .fh = NFS_FH(dir), diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index 1868246..191aa57 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c @@ -162,7 +162,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) * @dentry: dentry to unlink */ static int -nfs_async_unlink(struct dentry *dentry, struct qstr *name) +nfs_async_unlink(struct dentry *dentry, const struct qstr *name) { struct nfs_unlinkdata *data; int status = -ENOMEM; diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index c304a11..890b4ab 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h @@ -1543,7 +1543,7 @@ struct nfs_rpc_ops { struct nfs_fattr *, struct nfs4_label *); int (*setattr) (struct dentry *, struct nfs_fattr *, struct iattr *); - int (*lookup) (struct inode *, struct qstr *, + int (*lookup) (struct inode *, const struct qstr *, struct nfs_fh *, struct nfs_fattr *, struct nfs4_label *); int (*access) (struct inode *, struct nfs_access_entry *); @@ -1551,18 +1551,18 @@ struct nfs_rpc_ops { unsigned int); int (*create) (struct inode *, struct dentry *, struct iattr *, int); - int (*remove) (struct inode *, struct qstr *); + int (*remove) (struct inode *, const struct qstr *); void (*unlink_setup) (struct rpc_message *, struct inode *dir); void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); int (*unlink_done) (struct rpc_task *, struct inode *); void (*rename_setup) (struct rpc_message *msg, struct inode *dir); void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *); int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); - int (*link) (struct inode *, struct inode *, struct qstr *); + int (*link) (struct inode *, struct inode *, const struct qstr *); int (*symlink) (struct inode *, struct dentry *, struct page *, unsigned int, struct iattr *); int (*mkdir) (struct inode *, struct dentry *, struct iattr *); - int (*rmdir) (struct inode *, struct qstr *); + int (*rmdir) (struct inode *, const struct qstr *); int (*readdir) (struct dentry *, struct rpc_cred *, u64, struct page **, unsigned int, int); int (*mknod) (struct inode *, struct dentry *, struct iattr *, -- cgit v0.10.2 From 9aba36dea59264d11cd36219937296b4903c89b6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 22:28:45 -0400 Subject: qstr constify instances in fs/dcache.c Signed-off-by: Al Viro diff --git a/fs/dcache.c b/fs/dcache.c index d6847d7..f12d9d0 100644 --- a/fs/dcache.c +++ b/fs/dcache.c @@ -2708,7 +2708,7 @@ EXPORT_SYMBOL(d_exact_alias); * Parent inode i_mutex must be held over d_lookup and into this call (to * keep renames and concurrent inserts, and readdir(2) away). */ -void dentry_update_name_case(struct dentry *dentry, struct qstr *name) +void dentry_update_name_case(struct dentry *dentry, const struct qstr *name) { BUG_ON(!inode_is_locked(dentry->d_parent->d_inode)); BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */ @@ -3111,7 +3111,7 @@ static int prepend(char **buffer, int *buflen, const char *str, int namelen) * Data dependency barrier is needed to make sure that we see that terminating * NUL. Alpha strikes again, film at 11... */ -static int prepend_name(char **buffer, int *buflen, struct qstr *name) +static int prepend_name(char **buffer, int *buflen, const struct qstr *name) { const char *dname = ACCESS_ONCE(name->name); u32 dlen = ACCESS_ONCE(name->len); diff --git a/include/linux/dcache.h b/include/linux/dcache.h index f53fa05..f912a1e 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h @@ -264,7 +264,7 @@ extern void d_rehash(struct dentry *); extern void d_add(struct dentry *, struct inode *); -extern void dentry_update_name_case(struct dentry *, struct qstr *); +extern void dentry_update_name_case(struct dentry *, const struct qstr *); /* used for rename() and baskets */ extern void d_move(struct dentry *, struct dentry *); -- cgit v0.10.2 From 13983d062f17fb69f249befeba81b5ca253ad641 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 22:34:44 -0400 Subject: qstr: constify instances in fuse Signed-off-by: Al Viro diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 264f07c..419230a 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -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); diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 929c383..9e42c03 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -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); /** diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index 9961d843..cdc4053 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c @@ -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) { -- cgit v0.10.2 From dc12e909490dcad210ee52bc1b0776c95dcc9edf Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 22:41:44 -0400 Subject: qstr: constify instances in procfs Signed-off-by: Al Viro diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 5e57c3e..04f69ea 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -474,7 +474,7 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, { struct ctl_table_header *head = grab_header(dir); struct ctl_table_header *h = NULL; - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; struct ctl_table *p; struct inode *inode; struct dentry *err = ERR_PTR(-ENOENT); -- cgit v0.10.2 From b59091c04ae02bc37fab86937e7aa998787d6bf1 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 22:43:14 -0400 Subject: qstr: constify instances in vfat Signed-off-by: Al Viro diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c index 7092584..1d16ed5 100644 --- a/fs/fat/namei_vfat.c +++ b/fs/fat/namei_vfat.c @@ -652,8 +652,8 @@ out_free: return err; } -static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir, - int cluster, struct timespec *ts, +static int vfat_add_entry(struct inode *dir, const struct qstr *qname, + int is_dir, int cluster, struct timespec *ts, struct fat_slot_info *sinfo) { struct msdos_dir_slot *slots; @@ -688,7 +688,7 @@ cleanup: return err; } -static int vfat_find(struct inode *dir, struct qstr *qname, +static int vfat_find(struct inode *dir, const struct qstr *qname, struct fat_slot_info *sinfo) { unsigned int len = vfat_striptail_len(qname); -- cgit v0.10.2 From ac3ba644bc8f9072155f16e4156dc4df845112f0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 22:47:26 -0400 Subject: qstr: constify instances in ext2 Signed-off-by: Al Viro diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 19efd11..61ad490 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -358,8 +358,8 @@ ext2_readdir(struct file *file, struct dir_context *ctx) * and the entry itself. Page is returned mapped and unlocked. * Entry is guaranteed to be valid. */ -struct ext2_dir_entry_2 *ext2_find_entry (struct inode * dir, - struct qstr *child, struct page ** res_page) +struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir, + const struct qstr *child, struct page **res_page) { const char *name = child->name; int namelen = child->len; @@ -435,7 +435,7 @@ struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) return de; } -ino_t ext2_inode_by_name(struct inode *dir, struct qstr *child) +ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child) { ino_t res = 0; struct ext2_dir_entry_2 *de; diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h index 170939f..24a270f 100644 --- a/fs/ext2/ext2.h +++ b/fs/ext2/ext2.h @@ -754,9 +754,9 @@ extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_wind /* dir.c */ extern int ext2_add_link (struct dentry *, struct inode *); -extern ino_t ext2_inode_by_name(struct inode *, struct qstr *); +extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *); extern int ext2_make_empty(struct inode *, struct inode *); -extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,struct qstr *, struct page **); +extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **); extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); extern int ext2_empty_dir (struct inode *); extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); -- cgit v0.10.2 From 185de68fcb397c8c275b536fe279cbfadf8b185c Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 23:07:13 -0400 Subject: qstr: constify instances in f2fs Signed-off-by: Al Viro diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c index f9313f6..3b095a3 100644 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@ -214,7 +214,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir, * Entry is guaranteed to be valid. */ struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir, - struct qstr *child, struct page **res_page) + const struct qstr *child, struct page **res_page) { unsigned long npages = dir_blocks(dir); struct f2fs_dir_entry *de = NULL; @@ -277,7 +277,7 @@ struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p) return de; } -ino_t f2fs_inode_by_name(struct inode *dir, struct qstr *qstr) +ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr) { ino_t res = 0; struct f2fs_dir_entry *de; diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index 916e7c2..fd0a156 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1805,10 +1805,10 @@ struct page *init_inode_metadata(struct inode *, struct inode *, void update_parent_metadata(struct inode *, struct inode *, unsigned int); int room_for_filename(const void *, int, int); void f2fs_drop_nlink(struct inode *, struct inode *, struct page *); -struct f2fs_dir_entry *f2fs_find_entry(struct inode *, struct qstr *, +struct f2fs_dir_entry *f2fs_find_entry(struct inode *, const struct qstr *, struct page **); struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **); -ino_t f2fs_inode_by_name(struct inode *, struct qstr *); +ino_t f2fs_inode_by_name(struct inode *, const struct qstr *); void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, struct page *, struct inode *); int update_dent_inode(struct inode *, struct inode *, const struct qstr *); -- cgit v0.10.2 From 1e95e9a0b7dd0e62a759e00329a106735bbcabd6 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 23:19:29 -0400 Subject: qstr: constify instances in lustre Signed-off-by: Al Viro diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c index 6322f88..d06129e 100644 --- a/drivers/staging/lustre/lustre/llite/statahead.c +++ b/drivers/staging/lustre/lustre/llite/statahead.c @@ -783,7 +783,7 @@ static int sa_args_init(struct inode *dir, struct inode *child, struct ll_sa_entry *entry, struct md_enqueue_info **pmi, struct ldlm_enqueue_info **pei) { - struct qstr *qstr = &entry->se_qstr; + const struct qstr *qstr = &entry->se_qstr; struct ll_inode_info *lli = ll_i2info(dir); struct md_enqueue_info *minfo; struct ldlm_enqueue_info *einfo; @@ -1342,7 +1342,7 @@ enum { static int is_first_dirent(struct inode *dir, struct dentry *dentry) { struct ll_dir_chain chain; - struct qstr *target = &dentry->d_name; + const struct qstr *target = &dentry->d_name; struct page *page; __u64 pos = 0; int dot_de; -- cgit v0.10.2 From 19a6d89de2f10ee3b18c3b9fd6c7c2e249a30d71 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 20 Jul 2016 23:23:32 -0400 Subject: qstr: constify instances in adfs Signed-off-by: Al Viro diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c index fd4cf2c..62ee2cb 100644 --- a/fs/adfs/dir.c +++ b/fs/adfs/dir.c @@ -101,7 +101,7 @@ out: } static int -adfs_match(struct qstr *name, struct object_info *obj) +adfs_match(const struct qstr *name, struct object_info *obj) { int i; @@ -126,7 +126,7 @@ adfs_match(struct qstr *name, struct object_info *obj) } static int -adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj) +adfs_dir_lookup_byname(struct inode *inode, const struct qstr *name, struct object_info *obj) { struct super_block *sb = inode->i_sb; const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; -- cgit v0.10.2