aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-08-06 09:49:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-08-06 09:49:02 -0400
commit835c92d43b29eb354abdbd5475308a474d7efdfa (patch)
tree9b7808c219f01859508d1a7fca2f39eccb4b19b9
parentce804bf598b59427a2c930e5c1f5fe2e51f1b517 (diff)
parent19a6d89de2f10ee3b18c3b9fd6c7c2e249a30d71 (diff)
Merge branch 'work.const-qstr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull qstr constification updates from Al Viro: "Fairly self-contained bunch - surprising lot of places passes struct qstr * as an argument when const struct qstr * would suffice; it complicates analysis for no good reason. I'd prefer to feed that separately from the assorted fixes (those are in #for-linus and with somewhat trickier topology)" * 'work.const-qstr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: qstr: constify instances in adfs qstr: constify instances in lustre qstr: constify instances in f2fs qstr: constify instances in ext2 qstr: constify instances in vfat qstr: constify instances in procfs qstr: constify instances in fuse qstr constify instances in fs/dcache.c qstr: constify instances in nfs qstr: constify instances in ocfs2 qstr: constify instances in autofs4 qstr: constify instances in hfs qstr: constify instances in hfsplus qstr: constify instances in logfs qstr: constify dentry_init_security
-rw-r--r--drivers/staging/lustre/lustre/llite/statahead.c4
-rw-r--r--fs/adfs/dir.c4
-rw-r--r--fs/autofs4/root.c8
-rw-r--r--fs/autofs4/waitq.c4
-rw-r--r--fs/dcache.c4
-rw-r--r--fs/ext2/dir.c6
-rw-r--r--fs/ext2/ext2.h4
-rw-r--r--fs/f2fs/dir.c4
-rw-r--r--fs/f2fs/f2fs.h4
-rw-r--r--fs/fat/namei_vfat.c6
-rw-r--r--fs/fuse/dir.c4
-rw-r--r--fs/fuse/fuse_i.h2
-rw-r--r--fs/fuse/inode.c8
-rw-r--r--fs/hfs/catalog.c12
-rw-r--r--fs/hfs/hfs_fs.h14
-rw-r--r--fs/hfs/inode.c2
-rw-r--r--fs/hfs/trans.c2
-rw-r--r--fs/hfsplus/catalog.c12
-rw-r--r--fs/hfsplus/hfsplus_fs.h10
-rw-r--r--fs/logfs/dir.c4
-rw-r--r--fs/nfs/nfs3proc.c8
-rw-r--r--fs/nfs/nfs4_fs.h5
-rw-r--r--fs/nfs/nfs4namespace.c4
-rw-r--r--fs/nfs/nfs4proc.c16
-rw-r--r--fs/nfs/proc.c8
-rw-r--r--fs/nfs/unlink.c2
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c4
-rw-r--r--fs/ocfs2/dlmfs/dlmfs.c4
-rw-r--r--fs/ocfs2/dlmfs/userdlm.c2
-rw-r--r--fs/ocfs2/dlmfs/userdlm.h2
-rw-r--r--fs/proc/proc_sysctl.c2
-rw-r--r--include/linux/dcache.h2
-rw-r--r--include/linux/lsm_hooks.h2
-rw-r--r--include/linux/nfs_xdr.h8
-rw-r--r--include/linux/security.h4
-rw-r--r--security/security.c2
-rw-r--r--security/selinux/hooks.c2
37 files changed, 95 insertions, 100 deletions
diff --git a/drivers/staging/lustre/lustre/llite/statahead.c b/drivers/staging/lustre/lustre/llite/statahead.c
index 8e52722266fe..c1cb6b19e724 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -781,7 +781,7 @@ static int sa_args_init(struct inode *dir, struct inode *child,
781 struct ll_sa_entry *entry, struct md_enqueue_info **pmi, 781 struct ll_sa_entry *entry, struct md_enqueue_info **pmi,
782 struct ldlm_enqueue_info **pei) 782 struct ldlm_enqueue_info **pei)
783{ 783{
784 struct qstr *qstr = &entry->se_qstr; 784 const struct qstr *qstr = &entry->se_qstr;
785 struct ll_inode_info *lli = ll_i2info(dir); 785 struct ll_inode_info *lli = ll_i2info(dir);
786 struct md_enqueue_info *minfo; 786 struct md_enqueue_info *minfo;
787 struct ldlm_enqueue_info *einfo; 787 struct ldlm_enqueue_info *einfo;
@@ -1340,7 +1340,7 @@ enum {
1340static int is_first_dirent(struct inode *dir, struct dentry *dentry) 1340static int is_first_dirent(struct inode *dir, struct dentry *dentry)
1341{ 1341{
1342 struct ll_dir_chain chain; 1342 struct ll_dir_chain chain;
1343 struct qstr *target = &dentry->d_name; 1343 const struct qstr *target = &dentry->d_name;
1344 struct page *page; 1344 struct page *page;
1345 __u64 pos = 0; 1345 __u64 pos = 0;
1346 int dot_de; 1346 int dot_de;
diff --git a/fs/adfs/dir.c b/fs/adfs/dir.c
index bec25f7017c0..c39aedc7ed3d 100644
--- a/fs/adfs/dir.c
+++ b/fs/adfs/dir.c
@@ -101,7 +101,7 @@ out:
101} 101}
102 102
103static int 103static int
104adfs_match(struct qstr *name, struct object_info *obj) 104adfs_match(const struct qstr *name, struct object_info *obj)
105{ 105{
106 int i; 106 int i;
107 107
@@ -126,7 +126,7 @@ adfs_match(struct qstr *name, struct object_info *obj)
126} 126}
127 127
128static int 128static int
129adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj) 129adfs_dir_lookup_byname(struct inode *inode, const struct qstr *name, struct object_info *obj)
130{ 130{
131 struct super_block *sb = inode->i_sb; 131 struct super_block *sb = inode->i_sb;
132 const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir; 132 const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c
index 3767f6641af1..fa84bb8832e0 100644
--- a/fs/autofs4/root.c
+++ b/fs/autofs4/root.c
@@ -159,7 +159,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry)
159{ 159{
160 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); 160 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
161 struct dentry *parent = dentry->d_parent; 161 struct dentry *parent = dentry->d_parent;
162 struct qstr *name = &dentry->d_name; 162 const struct qstr *name = &dentry->d_name;
163 unsigned int len = name->len; 163 unsigned int len = name->len;
164 unsigned int hash = name->hash; 164 unsigned int hash = name->hash;
165 const unsigned char *str = name->name; 165 const unsigned char *str = name->name;
@@ -172,7 +172,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry)
172 list_for_each(p, head) { 172 list_for_each(p, head) {
173 struct autofs_info *ino; 173 struct autofs_info *ino;
174 struct dentry *active; 174 struct dentry *active;
175 struct qstr *qstr; 175 const struct qstr *qstr;
176 176
177 ino = list_entry(p, struct autofs_info, active); 177 ino = list_entry(p, struct autofs_info, active);
178 active = ino->dentry; 178 active = ino->dentry;
@@ -214,7 +214,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry,
214{ 214{
215 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); 215 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
216 struct dentry *parent = dentry->d_parent; 216 struct dentry *parent = dentry->d_parent;
217 struct qstr *name = &dentry->d_name; 217 const struct qstr *name = &dentry->d_name;
218 unsigned int len = name->len; 218 unsigned int len = name->len;
219 unsigned int hash = name->hash; 219 unsigned int hash = name->hash;
220 const unsigned char *str = name->name; 220 const unsigned char *str = name->name;
@@ -227,7 +227,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry,
227 list_for_each(p, head) { 227 list_for_each(p, head) {
228 struct autofs_info *ino; 228 struct autofs_info *ino;
229 struct dentry *expiring; 229 struct dentry *expiring;
230 struct qstr *qstr; 230 const struct qstr *qstr;
231 231
232 if (rcu_walk) { 232 if (rcu_walk) {
233 spin_unlock(&sbi->lookup_lock); 233 spin_unlock(&sbi->lookup_lock);
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c
index 708214457d16..431fd7ee3488 100644
--- a/fs/autofs4/waitq.c
+++ b/fs/autofs4/waitq.c
@@ -225,7 +225,7 @@ rename_retry:
225} 225}
226 226
227static struct autofs_wait_queue * 227static struct autofs_wait_queue *
228autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr) 228autofs4_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr)
229{ 229{
230 struct autofs_wait_queue *wq; 230 struct autofs_wait_queue *wq;
231 231
@@ -249,7 +249,7 @@ autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr)
249 */ 249 */
250static int validate_request(struct autofs_wait_queue **wait, 250static int validate_request(struct autofs_wait_queue **wait,
251 struct autofs_sb_info *sbi, 251 struct autofs_sb_info *sbi,
252 struct qstr *qstr, 252 const struct qstr *qstr,
253 struct dentry *dentry, enum autofs_notify notify) 253 struct dentry *dentry, enum autofs_notify notify)
254{ 254{
255 struct autofs_wait_queue *wq; 255 struct autofs_wait_queue *wq;
diff --git a/fs/dcache.c b/fs/dcache.c
index b90cf8e09d5b..96635a30fb26 100644
--- a/fs/dcache.c
+++ b/fs/dcache.c
@@ -2636,7 +2636,7 @@ EXPORT_SYMBOL(d_exact_alias);
2636 * Parent inode i_mutex must be held over d_lookup and into this call (to 2636 * Parent inode i_mutex must be held over d_lookup and into this call (to
2637 * keep renames and concurrent inserts, and readdir(2) away). 2637 * keep renames and concurrent inserts, and readdir(2) away).
2638 */ 2638 */
2639void dentry_update_name_case(struct dentry *dentry, struct qstr *name) 2639void dentry_update_name_case(struct dentry *dentry, const struct qstr *name)
2640{ 2640{
2641 BUG_ON(!inode_is_locked(dentry->d_parent->d_inode)); 2641 BUG_ON(!inode_is_locked(dentry->d_parent->d_inode));
2642 BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */ 2642 BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */
@@ -3038,7 +3038,7 @@ static int prepend(char **buffer, int *buflen, const char *str, int namelen)
3038 * Data dependency barrier is needed to make sure that we see that terminating 3038 * Data dependency barrier is needed to make sure that we see that terminating
3039 * NUL. Alpha strikes again, film at 11... 3039 * NUL. Alpha strikes again, film at 11...
3040 */ 3040 */
3041static int prepend_name(char **buffer, int *buflen, struct qstr *name) 3041static int prepend_name(char **buffer, int *buflen, const struct qstr *name)
3042{ 3042{
3043 const char *dname = ACCESS_ONCE(name->name); 3043 const char *dname = ACCESS_ONCE(name->name);
3044 u32 dlen = ACCESS_ONCE(name->len); 3044 u32 dlen = ACCESS_ONCE(name->len);
diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c
index 19efd1197fa5..61ad490ed67b 100644
--- a/fs/ext2/dir.c
+++ b/fs/ext2/dir.c
@@ -358,8 +358,8 @@ ext2_readdir(struct file *file, struct dir_context *ctx)
358 * and the entry itself. Page is returned mapped and unlocked. 358 * and the entry itself. Page is returned mapped and unlocked.
359 * Entry is guaranteed to be valid. 359 * Entry is guaranteed to be valid.
360 */ 360 */
361struct ext2_dir_entry_2 *ext2_find_entry (struct inode * dir, 361struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir,
362 struct qstr *child, struct page ** res_page) 362 const struct qstr *child, struct page **res_page)
363{ 363{
364 const char *name = child->name; 364 const char *name = child->name;
365 int namelen = child->len; 365 int namelen = child->len;
@@ -435,7 +435,7 @@ struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p)
435 return de; 435 return de;
436} 436}
437 437
438ino_t ext2_inode_by_name(struct inode *dir, struct qstr *child) 438ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child)
439{ 439{
440 ino_t res = 0; 440 ino_t res = 0;
441 struct ext2_dir_entry_2 *de; 441 struct ext2_dir_entry_2 *de;
diff --git a/fs/ext2/ext2.h b/fs/ext2/ext2.h
index 3fb93681bf7f..06af2f92226c 100644
--- a/fs/ext2/ext2.h
+++ b/fs/ext2/ext2.h
@@ -757,9 +757,9 @@ extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_wind
757 757
758/* dir.c */ 758/* dir.c */
759extern int ext2_add_link (struct dentry *, struct inode *); 759extern int ext2_add_link (struct dentry *, struct inode *);
760extern ino_t ext2_inode_by_name(struct inode *, struct qstr *); 760extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *);
761extern int ext2_make_empty(struct inode *, struct inode *); 761extern int ext2_make_empty(struct inode *, struct inode *);
762extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,struct qstr *, struct page **); 762extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **);
763extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *); 763extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
764extern int ext2_empty_dir (struct inode *); 764extern int ext2_empty_dir (struct inode *);
765extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **); 765extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
diff --git a/fs/f2fs/dir.c b/fs/f2fs/dir.c
index a485f68a76b1..9054aeac8015 100644
--- a/fs/f2fs/dir.c
+++ b/fs/f2fs/dir.c
@@ -219,7 +219,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir,
219 * Entry is guaranteed to be valid. 219 * Entry is guaranteed to be valid.
220 */ 220 */
221struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir, 221struct f2fs_dir_entry *f2fs_find_entry(struct inode *dir,
222 struct qstr *child, struct page **res_page) 222 const struct qstr *child, struct page **res_page)
223{ 223{
224 unsigned long npages = dir_blocks(dir); 224 unsigned long npages = dir_blocks(dir);
225 struct f2fs_dir_entry *de = NULL; 225 struct f2fs_dir_entry *de = NULL;
@@ -272,7 +272,7 @@ struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p)
272 return f2fs_find_entry(dir, &dotdot, p); 272 return f2fs_find_entry(dir, &dotdot, p);
273} 273}
274 274
275ino_t f2fs_inode_by_name(struct inode *dir, struct qstr *qstr, 275ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr,
276 struct page **page) 276 struct page **page)
277{ 277{
278 ino_t res = 0; 278 ino_t res = 0;
diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
index 7890e9071499..675fa79d86f6 100644
--- a/fs/f2fs/f2fs.h
+++ b/fs/f2fs/f2fs.h
@@ -1914,10 +1914,10 @@ struct page *init_inode_metadata(struct inode *, struct inode *,
1914void update_parent_metadata(struct inode *, struct inode *, unsigned int); 1914void update_parent_metadata(struct inode *, struct inode *, unsigned int);
1915int room_for_filename(const void *, int, int); 1915int room_for_filename(const void *, int, int);
1916void f2fs_drop_nlink(struct inode *, struct inode *); 1916void f2fs_drop_nlink(struct inode *, struct inode *);
1917struct f2fs_dir_entry *f2fs_find_entry(struct inode *, struct qstr *, 1917struct f2fs_dir_entry *f2fs_find_entry(struct inode *, const struct qstr *,
1918 struct page **); 1918 struct page **);
1919struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **); 1919struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **);
1920ino_t f2fs_inode_by_name(struct inode *, struct qstr *, struct page **); 1920ino_t f2fs_inode_by_name(struct inode *, const struct qstr *, struct page **);
1921void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, 1921void f2fs_set_link(struct inode *, struct f2fs_dir_entry *,
1922 struct page *, struct inode *); 1922 struct page *, struct inode *);
1923int update_dent_inode(struct inode *, struct inode *, const struct qstr *); 1923int update_dent_inode(struct inode *, struct inode *, const struct qstr *);
diff --git a/fs/fat/namei_vfat.c b/fs/fat/namei_vfat.c
index 6ccdf3f34f90..092b911f5c4e 100644
--- a/fs/fat/namei_vfat.c
+++ b/fs/fat/namei_vfat.c
@@ -652,8 +652,8 @@ out_free:
652 return err; 652 return err;
653} 653}
654 654
655static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir, 655static int vfat_add_entry(struct inode *dir, const struct qstr *qname,
656 int cluster, struct timespec *ts, 656 int is_dir, int cluster, struct timespec *ts,
657 struct fat_slot_info *sinfo) 657 struct fat_slot_info *sinfo)
658{ 658{
659 struct msdos_dir_slot *slots; 659 struct msdos_dir_slot *slots;
@@ -688,7 +688,7 @@ cleanup:
688 return err; 688 return err;
689} 689}
690 690
691static int vfat_find(struct inode *dir, struct qstr *qname, 691static int vfat_find(struct inode *dir, const struct qstr *qname,
692 struct fat_slot_info *sinfo) 692 struct fat_slot_info *sinfo)
693{ 693{
694 unsigned int len = vfat_striptail_len(qname); 694 unsigned int len = vfat_striptail_len(qname);
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 5f1627725791..c47b7780ce37 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -146,7 +146,7 @@ static void fuse_invalidate_entry(struct dentry *entry)
146} 146}
147 147
148static void fuse_lookup_init(struct fuse_conn *fc, struct fuse_args *args, 148static void fuse_lookup_init(struct fuse_conn *fc, struct fuse_args *args,
149 u64 nodeid, struct qstr *name, 149 u64 nodeid, const struct qstr *name,
150 struct fuse_entry_out *outarg) 150 struct fuse_entry_out *outarg)
151{ 151{
152 memset(outarg, 0, sizeof(struct fuse_entry_out)); 152 memset(outarg, 0, sizeof(struct fuse_entry_out));
@@ -282,7 +282,7 @@ int fuse_valid_type(int m)
282 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m); 282 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m);
283} 283}
284 284
285int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name, 285int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name,
286 struct fuse_entry_out *outarg, struct inode **inode) 286 struct fuse_entry_out *outarg, struct inode **inode)
287{ 287{
288 struct fuse_conn *fc = get_fuse_conn_super(sb); 288 struct fuse_conn *fc = get_fuse_conn_super(sb);
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h
index 5db5d24f91a5..d98d8cc84def 100644
--- a/fs/fuse/fuse_i.h
+++ b/fs/fuse/fuse_i.h
@@ -704,7 +704,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid,
704 int generation, struct fuse_attr *attr, 704 int generation, struct fuse_attr *attr,
705 u64 attr_valid, u64 attr_version); 705 u64 attr_valid, u64 attr_version);
706 706
707int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name, 707int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name,
708 struct fuse_entry_out *outarg, struct inode **inode); 708 struct fuse_entry_out *outarg, struct inode **inode);
709 709
710/** 710/**
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 9b7cb37b4ba8..4e05b51120f4 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,
673 inode = ilookup5(sb, handle->nodeid, fuse_inode_eq, &handle->nodeid); 673 inode = ilookup5(sb, handle->nodeid, fuse_inode_eq, &handle->nodeid);
674 if (!inode) { 674 if (!inode) {
675 struct fuse_entry_out outarg; 675 struct fuse_entry_out outarg;
676 struct qstr name; 676 const struct qstr name = QSTR_INIT(".", 1);
677 677
678 if (!fc->export_support) 678 if (!fc->export_support)
679 goto out_err; 679 goto out_err;
680 680
681 name.len = 1;
682 name.name = ".";
683 err = fuse_lookup_name(sb, handle->nodeid, &name, &outarg, 681 err = fuse_lookup_name(sb, handle->nodeid, &name, &outarg,
684 &inode); 682 &inode);
685 if (err && err != -ENOENT) 683 if (err && err != -ENOENT)
@@ -775,14 +773,12 @@ static struct dentry *fuse_get_parent(struct dentry *child)
775 struct inode *inode; 773 struct inode *inode;
776 struct dentry *parent; 774 struct dentry *parent;
777 struct fuse_entry_out outarg; 775 struct fuse_entry_out outarg;
778 struct qstr name; 776 const struct qstr name = QSTR_INIT("..", 2);
779 int err; 777 int err;
780 778
781 if (!fc->export_support) 779 if (!fc->export_support)
782 return ERR_PTR(-ESTALE); 780 return ERR_PTR(-ESTALE);
783 781
784 name.len = 2;
785 name.name = "..";
786 err = fuse_lookup_name(child_inode->i_sb, get_node_id(child_inode), 782 err = fuse_lookup_name(child_inode->i_sb, get_node_id(child_inode),
787 &name, &outarg, &inode); 783 &name, &outarg, &inode);
788 if (err) { 784 if (err) {
diff --git a/fs/hfs/catalog.c b/fs/hfs/catalog.c
index 98cde8ba5dc2..8f4afd3f5108 100644
--- a/fs/hfs/catalog.c
+++ b/fs/hfs/catalog.c
@@ -20,7 +20,7 @@
20 * 20 *
21 * Given the ID of the parent and the name build a search key. 21 * Given the ID of the parent and the name build a search key.
22 */ 22 */
23void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, struct qstr *name) 23void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, const struct qstr *name)
24{ 24{
25 key->cat.reserved = 0; 25 key->cat.reserved = 0;
26 key->cat.ParID = cpu_to_be32(parent); 26 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)
64 64
65static int hfs_cat_build_thread(struct super_block *sb, 65static int hfs_cat_build_thread(struct super_block *sb,
66 hfs_cat_rec *rec, int type, 66 hfs_cat_rec *rec, int type,
67 u32 parentid, struct qstr *name) 67 u32 parentid, const struct qstr *name)
68{ 68{
69 rec->type = type; 69 rec->type = type;
70 memset(rec->thread.reserved, 0, sizeof(rec->thread.reserved)); 70 memset(rec->thread.reserved, 0, sizeof(rec->thread.reserved));
@@ -79,7 +79,7 @@ static int hfs_cat_build_thread(struct super_block *sb,
79 * Add a new file or directory to the catalog B-tree and 79 * Add a new file or directory to the catalog B-tree and
80 * return a (struct hfs_cat_entry) for it in '*result'. 80 * return a (struct hfs_cat_entry) for it in '*result'.
81 */ 81 */
82int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *inode) 82int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct inode *inode)
83{ 83{
84 struct hfs_find_data fd; 84 struct hfs_find_data fd;
85 struct super_block *sb; 85 struct super_block *sb;
@@ -210,7 +210,7 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid,
210 * Delete the indicated file or directory. 210 * Delete the indicated file or directory.
211 * The associated thread is also removed unless ('with_thread'==0). 211 * The associated thread is also removed unless ('with_thread'==0).
212 */ 212 */
213int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str) 213int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str)
214{ 214{
215 struct super_block *sb; 215 struct super_block *sb;
216 struct hfs_find_data fd; 216 struct hfs_find_data fd;
@@ -277,8 +277,8 @@ out:
277 * If the destination exists it is removed and a 277 * If the destination exists it is removed and a
278 * (struct hfs_cat_entry) for it is returned in '*result'. 278 * (struct hfs_cat_entry) for it is returned in '*result'.
279 */ 279 */
280int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name, 280int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
281 struct inode *dst_dir, struct qstr *dst_name) 281 struct inode *dst_dir, const struct qstr *dst_name)
282{ 282{
283 struct super_block *sb; 283 struct super_block *sb;
284 struct hfs_find_data src_fd, dst_fd; 284 struct hfs_find_data src_fd, dst_fd;
diff --git a/fs/hfs/hfs_fs.h b/fs/hfs/hfs_fs.h
index ee2f385811c8..e799ebe71b51 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);
178extern int hfs_cat_keycmp(const btree_key *, const btree_key *); 178extern int hfs_cat_keycmp(const btree_key *, const btree_key *);
179struct hfs_find_data; 179struct hfs_find_data;
180extern int hfs_cat_find_brec(struct super_block *, u32, struct hfs_find_data *); 180extern int hfs_cat_find_brec(struct super_block *, u32, struct hfs_find_data *);
181extern int hfs_cat_create(u32, struct inode *, struct qstr *, struct inode *); 181extern int hfs_cat_create(u32, struct inode *, const struct qstr *, struct inode *);
182extern int hfs_cat_delete(u32, struct inode *, struct qstr *); 182extern int hfs_cat_delete(u32, struct inode *, const struct qstr *);
183extern int hfs_cat_move(u32, struct inode *, struct qstr *, 183extern int hfs_cat_move(u32, struct inode *, const struct qstr *,
184 struct inode *, struct qstr *); 184 struct inode *, const struct qstr *);
185extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *); 185extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, const struct qstr *);
186 186
187/* dir.c */ 187/* dir.c */
188extern const struct file_operations hfs_dir_operations; 188extern const struct file_operations hfs_dir_operations;
@@ -201,7 +201,7 @@ extern int hfs_get_block(struct inode *, sector_t, struct buffer_head *, int);
201extern const struct address_space_operations hfs_aops; 201extern const struct address_space_operations hfs_aops;
202extern const struct address_space_operations hfs_btree_aops; 202extern const struct address_space_operations hfs_btree_aops;
203 203
204extern struct inode *hfs_new_inode(struct inode *, struct qstr *, umode_t); 204extern struct inode *hfs_new_inode(struct inode *, const struct qstr *, umode_t);
205extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *); 205extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *);
206extern int hfs_write_inode(struct inode *, struct writeback_control *); 206extern int hfs_write_inode(struct inode *, struct writeback_control *);
207extern int hfs_inode_setattr(struct dentry *, struct iattr *); 207extern int hfs_inode_setattr(struct dentry *, struct iattr *);
@@ -237,7 +237,7 @@ extern int hfs_compare_dentry(const struct dentry *parent, const struct dentry *
237 unsigned int len, const char *str, const struct qstr *name); 237 unsigned int len, const char *str, const struct qstr *name);
238 238
239/* trans.c */ 239/* trans.c */
240extern void hfs_asc2mac(struct super_block *, struct hfs_name *, struct qstr *); 240extern void hfs_asc2mac(struct super_block *, struct hfs_name *, const struct qstr *);
241extern int hfs_mac2asc(struct super_block *, char *, const struct hfs_name *); 241extern int hfs_mac2asc(struct super_block *, char *, const struct hfs_name *);
242 242
243/* super.c */ 243/* super.c */
diff --git a/fs/hfs/inode.c b/fs/hfs/inode.c
index 02a3845363f7..c6a32415735b 100644
--- a/fs/hfs/inode.c
+++ b/fs/hfs/inode.c
@@ -177,7 +177,7 @@ const struct address_space_operations hfs_aops = {
177/* 177/*
178 * hfs_new_inode 178 * hfs_new_inode
179 */ 179 */
180struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode) 180struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t mode)
181{ 181{
182 struct super_block *sb = dir->i_sb; 182 struct super_block *sb = dir->i_sb;
183 struct inode *inode = new_inode(sb); 183 struct inode *inode = new_inode(sb);
diff --git a/fs/hfs/trans.c b/fs/hfs/trans.c
index b1ce4c7ad3fb..39f5e343bf4d 100644
--- a/fs/hfs/trans.c
+++ b/fs/hfs/trans.c
@@ -94,7 +94,7 @@ out:
94 * This routine is a inverse to hfs_mac2triv(). 94 * This routine is a inverse to hfs_mac2triv().
95 * A ':' is replaced by a '/'. 95 * A ':' is replaced by a '/'.
96 */ 96 */
97void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, struct qstr *in) 97void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, const struct qstr *in)
98{ 98{
99 struct nls_table *nls_disk = HFS_SB(sb)->nls_disk; 99 struct nls_table *nls_disk = HFS_SB(sb)->nls_disk;
100 struct nls_table *nls_io = HFS_SB(sb)->nls_io; 100 struct nls_table *nls_io = HFS_SB(sb)->nls_io;
diff --git a/fs/hfsplus/catalog.c b/fs/hfsplus/catalog.c
index fb707e8f423a..142534d3c2d5 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,
40 40
41/* Generates key for catalog file/folders record. */ 41/* Generates key for catalog file/folders record. */
42int hfsplus_cat_build_key(struct super_block *sb, 42int hfsplus_cat_build_key(struct super_block *sb,
43 hfsplus_btree_key *key, u32 parent, struct qstr *str) 43 hfsplus_btree_key *key, u32 parent, const struct qstr *str)
44{ 44{
45 int len, err; 45 int len, err;
46 46
@@ -174,7 +174,7 @@ static int hfsplus_cat_build_record(hfsplus_cat_entry *entry,
174 174
175static int hfsplus_fill_cat_thread(struct super_block *sb, 175static int hfsplus_fill_cat_thread(struct super_block *sb,
176 hfsplus_cat_entry *entry, int type, 176 hfsplus_cat_entry *entry, int type,
177 u32 parentid, struct qstr *str) 177 u32 parentid, const struct qstr *str)
178{ 178{
179 int err; 179 int err;
180 180
@@ -250,7 +250,7 @@ static void hfsplus_subfolders_dec(struct inode *dir)
250} 250}
251 251
252int hfsplus_create_cat(u32 cnid, struct inode *dir, 252int hfsplus_create_cat(u32 cnid, struct inode *dir,
253 struct qstr *str, struct inode *inode) 253 const struct qstr *str, struct inode *inode)
254{ 254{
255 struct super_block *sb = dir->i_sb; 255 struct super_block *sb = dir->i_sb;
256 struct hfs_find_data fd; 256 struct hfs_find_data fd;
@@ -318,7 +318,7 @@ err2:
318 return err; 318 return err;
319} 319}
320 320
321int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str) 321int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str)
322{ 322{
323 struct super_block *sb = dir->i_sb; 323 struct super_block *sb = dir->i_sb;
324 struct hfs_find_data fd; 324 struct hfs_find_data fd;
@@ -415,8 +415,8 @@ out:
415} 415}
416 416
417int hfsplus_rename_cat(u32 cnid, 417int hfsplus_rename_cat(u32 cnid,
418 struct inode *src_dir, struct qstr *src_name, 418 struct inode *src_dir, const struct qstr *src_name,
419 struct inode *dst_dir, struct qstr *dst_name) 419 struct inode *dst_dir, const struct qstr *dst_name)
420{ 420{
421 struct super_block *sb = src_dir->i_sb; 421 struct super_block *sb = src_dir->i_sb;
422 struct hfs_find_data src_fd, dst_fd; 422 struct hfs_find_data src_fd, dst_fd;
diff --git a/fs/hfsplus/hfsplus_fs.h b/fs/hfsplus/hfsplus_fs.h
index 047245bd2cd6..47e009666abd 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,
445int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1, 445int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1,
446 const hfsplus_btree_key *k2); 446 const hfsplus_btree_key *k2);
447int hfsplus_cat_build_key(struct super_block *sb, hfsplus_btree_key *key, 447int hfsplus_cat_build_key(struct super_block *sb, hfsplus_btree_key *key,
448 u32 parent, struct qstr *str); 448 u32 parent, const struct qstr *str);
449void hfsplus_cat_build_key_with_cnid(struct super_block *sb, 449void hfsplus_cat_build_key_with_cnid(struct super_block *sb,
450 hfsplus_btree_key *key, u32 parent); 450 hfsplus_btree_key *key, u32 parent);
451void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms); 451void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms);
452int hfsplus_find_cat(struct super_block *sb, u32 cnid, 452int hfsplus_find_cat(struct super_block *sb, u32 cnid,
453 struct hfs_find_data *fd); 453 struct hfs_find_data *fd);
454int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str, 454int hfsplus_create_cat(u32 cnid, struct inode *dir, const struct qstr *str,
455 struct inode *inode); 455 struct inode *inode);
456int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str); 456int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str);
457int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, struct qstr *src_name, 457int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
458 struct inode *dst_dir, struct qstr *dst_name); 458 struct inode *dst_dir, const struct qstr *dst_name);
459 459
460/* dir.c */ 460/* dir.c */
461extern const struct inode_operations hfsplus_dir_inode_operations; 461extern const struct inode_operations hfsplus_dir_inode_operations;
diff --git a/fs/logfs/dir.c b/fs/logfs/dir.c
index bcd754d216bd..9568064ecadf 100644
--- a/fs/logfs/dir.c
+++ b/fs/logfs/dir.c
@@ -156,7 +156,7 @@ static pgoff_t hash_index(u32 hash, int round)
156 156
157static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry) 157static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry)
158{ 158{
159 struct qstr *name = &dentry->d_name; 159 const struct qstr *name = &dentry->d_name;
160 struct page *page; 160 struct page *page;
161 struct logfs_disk_dentry *dd; 161 struct logfs_disk_dentry *dd;
162 u32 hash = logfs_hash_32(name->name, name->len, 0); 162 u32 hash = logfs_hash_32(name->name, name->len, 0);
@@ -323,7 +323,7 @@ static int logfs_readdir(struct file *file, struct dir_context *ctx)
323 return 0; 323 return 0;
324} 324}
325 325
326static void logfs_set_name(struct logfs_disk_dentry *dd, struct qstr *name) 326static void logfs_set_name(struct logfs_disk_dentry *dd, const struct qstr *name)
327{ 327{
328 dd->namelen = cpu_to_be16(name->len); 328 dd->namelen = cpu_to_be16(name->len);
329 memcpy(dd->name, name->name, name->len); 329 memcpy(dd->name, name->name, name->len);
diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
index cb28cceefebe..698be9361280 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,
144} 144}
145 145
146static int 146static int
147nfs3_proc_lookup(struct inode *dir, struct qstr *name, 147nfs3_proc_lookup(struct inode *dir, const struct qstr *name,
148 struct nfs_fh *fhandle, struct nfs_fattr *fattr, 148 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
149 struct nfs4_label *label) 149 struct nfs4_label *label)
150{ 150{
@@ -404,7 +404,7 @@ out:
404} 404}
405 405
406static int 406static int
407nfs3_proc_remove(struct inode *dir, struct qstr *name) 407nfs3_proc_remove(struct inode *dir, const struct qstr *name)
408{ 408{
409 struct nfs_removeargs arg = { 409 struct nfs_removeargs arg = {
410 .fh = NFS_FH(dir), 410 .fh = NFS_FH(dir),
@@ -480,7 +480,7 @@ nfs3_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
480} 480}
481 481
482static int 482static int
483nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) 483nfs3_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
484{ 484{
485 struct nfs3_linkargs arg = { 485 struct nfs3_linkargs arg = {
486 .fromfh = NFS_FH(inode), 486 .fromfh = NFS_FH(inode),
@@ -582,7 +582,7 @@ out:
582} 582}
583 583
584static int 584static int
585nfs3_proc_rmdir(struct inode *dir, struct qstr *name) 585nfs3_proc_rmdir(struct inode *dir, const struct qstr *name)
586{ 586{
587 struct nfs_fattr *dir_attr; 587 struct nfs_fattr *dir_attr;
588 struct nfs3_diropargs arg = { 588 struct nfs3_diropargs arg = {
diff --git a/fs/nfs/nfs4_fs.h b/fs/nfs/nfs4_fs.h
index 4be567a54958..324bfdc21250 100644
--- a/fs/nfs/nfs4_fs.h
+++ b/fs/nfs/nfs4_fs.h
@@ -225,7 +225,8 @@ int nfs_atomic_open(struct inode *, struct dentry *, struct file *,
225extern struct file_system_type nfs4_fs_type; 225extern struct file_system_type nfs4_fs_type;
226 226
227/* nfs4namespace.c */ 227/* nfs4namespace.c */
228struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, struct qstr *); 228struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
229 const struct qstr *);
229struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *, 230struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
230 struct nfs_fh *, struct nfs_fattr *); 231 struct nfs_fh *, struct nfs_fattr *);
231int nfs4_replace_transport(struct nfs_server *server, 232int nfs4_replace_transport(struct nfs_server *server,
@@ -252,7 +253,7 @@ extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struc
252extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *, 253extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *,
253 struct page *page, struct rpc_cred *); 254 struct page *page, struct rpc_cred *);
254extern int nfs4_proc_fsid_present(struct inode *, struct rpc_cred *); 255extern int nfs4_proc_fsid_present(struct inode *, struct rpc_cred *);
255extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, struct qstr *, 256extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, const struct qstr *,
256 struct nfs_fh *, struct nfs_fattr *); 257 struct nfs_fh *, struct nfs_fattr *);
257extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *); 258extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
258extern const struct xattr_handler *nfs4_xattr_handlers[]; 259extern const struct xattr_handler *nfs4_xattr_handlers[];
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index f592672373cb..d21104912676 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,
208 */ 208 */
209struct rpc_clnt * 209struct rpc_clnt *
210nfs4_negotiate_security(struct rpc_clnt *clnt, struct inode *inode, 210nfs4_negotiate_security(struct rpc_clnt *clnt, struct inode *inode,
211 struct qstr *name) 211 const struct qstr *name)
212{ 212{
213 struct page *page; 213 struct page *page;
214 struct nfs4_secinfo_flavors *flavors; 214 struct nfs4_secinfo_flavors *flavors;
@@ -397,7 +397,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry,
397 rpc_authflavor_t flavor = server->client->cl_auth->au_flavor; 397 rpc_authflavor_t flavor = server->client->cl_auth->au_flavor;
398 struct dentry *parent = dget_parent(dentry); 398 struct dentry *parent = dget_parent(dentry);
399 struct inode *dir = d_inode(parent); 399 struct inode *dir = d_inode(parent);
400 struct qstr *name = &dentry->d_name; 400 const struct qstr *name = &dentry->d_name;
401 struct rpc_clnt *client; 401 struct rpc_clnt *client;
402 struct vfsmount *mnt; 402 struct vfsmount *mnt;
403 403
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index da5c9e58e907..a036e93bdf96 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -3538,7 +3538,7 @@ static void nfs_fixup_secinfo_attributes(struct nfs_fattr *fattr)
3538} 3538}
3539 3539
3540static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir, 3540static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
3541 struct qstr *name, struct nfs_fh *fhandle, 3541 const struct qstr *name, struct nfs_fh *fhandle,
3542 struct nfs_fattr *fattr, struct nfs4_label *label) 3542 struct nfs_fattr *fattr, struct nfs4_label *label)
3543{ 3543{
3544 struct nfs4_exception exception = { }; 3544 struct nfs4_exception exception = { };
@@ -3580,7 +3580,7 @@ out:
3580 return err; 3580 return err;
3581} 3581}
3582 3582
3583static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, 3583static int nfs4_proc_lookup(struct inode *dir, const struct qstr *name,
3584 struct nfs_fh *fhandle, struct nfs_fattr *fattr, 3584 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
3585 struct nfs4_label *label) 3585 struct nfs4_label *label)
3586{ 3586{
@@ -3596,7 +3596,7 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name,
3596} 3596}
3597 3597
3598struct rpc_clnt * 3598struct rpc_clnt *
3599nfs4_proc_lookup_mountpoint(struct inode *dir, struct qstr *name, 3599nfs4_proc_lookup_mountpoint(struct inode *dir, const struct qstr *name,
3600 struct nfs_fh *fhandle, struct nfs_fattr *fattr) 3600 struct nfs_fh *fhandle, struct nfs_fattr *fattr)
3601{ 3601{
3602 struct rpc_clnt *client = NFS_CLIENT(dir); 3602 struct rpc_clnt *client = NFS_CLIENT(dir);
@@ -3755,7 +3755,7 @@ out:
3755 return status; 3755 return status;
3756} 3756}
3757 3757
3758static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) 3758static int _nfs4_proc_remove(struct inode *dir, const struct qstr *name)
3759{ 3759{
3760 struct nfs_server *server = NFS_SERVER(dir); 3760 struct nfs_server *server = NFS_SERVER(dir);
3761 struct nfs_removeargs args = { 3761 struct nfs_removeargs args = {
@@ -3778,7 +3778,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
3778 return status; 3778 return status;
3779} 3779}
3780 3780
3781static int nfs4_proc_remove(struct inode *dir, struct qstr *name) 3781static int nfs4_proc_remove(struct inode *dir, const struct qstr *name)
3782{ 3782{
3783 struct nfs4_exception exception = { }; 3783 struct nfs4_exception exception = { };
3784 int err; 3784 int err;
@@ -3861,7 +3861,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
3861 return 1; 3861 return 1;
3862} 3862}
3863 3863
3864static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) 3864static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
3865{ 3865{
3866 struct nfs_server *server = NFS_SERVER(inode); 3866 struct nfs_server *server = NFS_SERVER(inode);
3867 struct nfs4_link_arg arg = { 3867 struct nfs4_link_arg arg = {
@@ -3908,7 +3908,7 @@ out:
3908 return status; 3908 return status;
3909} 3909}
3910 3910
3911static int nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) 3911static int nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
3912{ 3912{
3913 struct nfs4_exception exception = { }; 3913 struct nfs4_exception exception = { };
3914 int err; 3914 int err;
@@ -3930,7 +3930,7 @@ struct nfs4_createdata {
3930}; 3930};
3931 3931
3932static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir, 3932static struct nfs4_createdata *nfs4_alloc_createdata(struct inode *dir,
3933 struct qstr *name, struct iattr *sattr, u32 ftype) 3933 const struct qstr *name, struct iattr *sattr, u32 ftype)
3934{ 3934{
3935 struct nfs4_createdata *data; 3935 struct nfs4_createdata *data;
3936 3936
diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
index b417bbcd9704..b7bca8303989 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,
145} 145}
146 146
147static int 147static int
148nfs_proc_lookup(struct inode *dir, struct qstr *name, 148nfs_proc_lookup(struct inode *dir, const struct qstr *name,
149 struct nfs_fh *fhandle, struct nfs_fattr *fattr, 149 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
150 struct nfs4_label *label) 150 struct nfs4_label *label)
151{ 151{
@@ -299,7 +299,7 @@ out:
299} 299}
300 300
301static int 301static int
302nfs_proc_remove(struct inode *dir, struct qstr *name) 302nfs_proc_remove(struct inode *dir, const struct qstr *name)
303{ 303{
304 struct nfs_removeargs arg = { 304 struct nfs_removeargs arg = {
305 .fh = NFS_FH(dir), 305 .fh = NFS_FH(dir),
@@ -357,7 +357,7 @@ nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir,
357} 357}
358 358
359static int 359static int
360nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name) 360nfs_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
361{ 361{
362 struct nfs_linkargs arg = { 362 struct nfs_linkargs arg = {
363 .fromfh = NFS_FH(inode), 363 .fromfh = NFS_FH(inode),
@@ -456,7 +456,7 @@ out:
456} 456}
457 457
458static int 458static int
459nfs_proc_rmdir(struct inode *dir, struct qstr *name) 459nfs_proc_rmdir(struct inode *dir, const struct qstr *name)
460{ 460{
461 struct nfs_diropargs arg = { 461 struct nfs_diropargs arg = {
462 .fh = NFS_FH(dir), 462 .fh = NFS_FH(dir),
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c
index 1868246f56e6..191aa577dd1f 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)
162 * @dentry: dentry to unlink 162 * @dentry: dentry to unlink
163 */ 163 */
164static int 164static int
165nfs_async_unlink(struct dentry *dentry, struct qstr *name) 165nfs_async_unlink(struct dentry *dentry, const struct qstr *name)
166{ 166{
167 struct nfs_unlinkdata *data; 167 struct nfs_unlinkdata *data;
168 int status = -ENOMEM; 168 int status = -ENOMEM;
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 12e064b8be9a..533bd524e41e 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)
172void __dlm_insert_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) 172void __dlm_insert_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
173{ 173{
174 struct hlist_head *bucket; 174 struct hlist_head *bucket;
175 struct qstr *q;
176 175
177 assert_spin_locked(&dlm->spinlock); 176 assert_spin_locked(&dlm->spinlock);
178 177
179 q = &res->lockname; 178 bucket = dlm_lockres_hash(dlm, res->lockname.hash);
180 bucket = dlm_lockres_hash(dlm, q->hash);
181 179
182 /* get a reference for our hashtable */ 180 /* get a reference for our hashtable */
183 dlm_lockres_get(res); 181 dlm_lockres_get(res);
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index 47b3b2d4e775..ef474cdd6404 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -469,7 +469,7 @@ static int dlmfs_mkdir(struct inode * dir,
469{ 469{
470 int status; 470 int status;
471 struct inode *inode = NULL; 471 struct inode *inode = NULL;
472 struct qstr *domain = &dentry->d_name; 472 const struct qstr *domain = &dentry->d_name;
473 struct dlmfs_inode_private *ip; 473 struct dlmfs_inode_private *ip;
474 struct ocfs2_cluster_connection *conn; 474 struct ocfs2_cluster_connection *conn;
475 475
@@ -518,7 +518,7 @@ static int dlmfs_create(struct inode *dir,
518{ 518{
519 int status = 0; 519 int status = 0;
520 struct inode *inode; 520 struct inode *inode;
521 struct qstr *name = &dentry->d_name; 521 const struct qstr *name = &dentry->d_name;
522 522
523 mlog(0, "create %.*s\n", name->len, name->name); 523 mlog(0, "create %.*s\n", name->len, name->name);
524 524
diff --git a/fs/ocfs2/dlmfs/userdlm.c b/fs/ocfs2/dlmfs/userdlm.c
index 0499e3fb7bdb..f70cda2f090d 100644
--- a/fs/ocfs2/dlmfs/userdlm.c
+++ b/fs/ocfs2/dlmfs/userdlm.c
@@ -667,7 +667,7 @@ void user_dlm_set_locking_protocol(void)
667 ocfs2_stack_glue_set_max_proto_version(&user_dlm_lproto.lp_max_version); 667 ocfs2_stack_glue_set_max_proto_version(&user_dlm_lproto.lp_max_version);
668} 668}
669 669
670struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name) 670struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name)
671{ 671{
672 int rc; 672 int rc;
673 struct ocfs2_cluster_connection *conn; 673 struct ocfs2_cluster_connection *conn;
diff --git a/fs/ocfs2/dlmfs/userdlm.h b/fs/ocfs2/dlmfs/userdlm.h
index 3b42d79531d7..ede94a6e7fd3 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,
83ssize_t user_dlm_read_lvb(struct inode *inode, 83ssize_t user_dlm_read_lvb(struct inode *inode,
84 char *val, 84 char *val,
85 unsigned int len); 85 unsigned int len);
86struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name); 86struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name);
87void user_dlm_unregister(struct ocfs2_cluster_connection *conn); 87void user_dlm_unregister(struct ocfs2_cluster_connection *conn);
88void user_dlm_set_locking_protocol(void); 88void user_dlm_set_locking_protocol(void);
89 89
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index b59db94d2ff4..ffbb513c06c6 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,
474{ 474{
475 struct ctl_table_header *head = grab_header(dir); 475 struct ctl_table_header *head = grab_header(dir);
476 struct ctl_table_header *h = NULL; 476 struct ctl_table_header *h = NULL;
477 struct qstr *name = &dentry->d_name; 477 const struct qstr *name = &dentry->d_name;
478 struct ctl_table *p; 478 struct ctl_table *p;
479 struct inode *inode; 479 struct inode *inode;
480 struct dentry *err = ERR_PTR(-ENOENT); 480 struct dentry *err = ERR_PTR(-ENOENT);
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 98044a8d1487..accfa1ef072a 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -263,7 +263,7 @@ extern void d_rehash(struct dentry *);
263 263
264extern void d_add(struct dentry *, struct inode *); 264extern void d_add(struct dentry *, struct inode *);
265 265
266extern void dentry_update_name_case(struct dentry *, struct qstr *); 266extern void dentry_update_name_case(struct dentry *, const struct qstr *);
267 267
268/* used for rename() and baskets */ 268/* used for rename() and baskets */
269extern void d_move(struct dentry *, struct dentry *); 269extern void d_move(struct dentry *, struct dentry *);
diff --git a/include/linux/lsm_hooks.h b/include/linux/lsm_hooks.h
index 7ae397669d8b..101bf19c0f41 100644
--- a/include/linux/lsm_hooks.h
+++ b/include/linux/lsm_hooks.h
@@ -1356,7 +1356,7 @@ union security_list_options {
1356 struct super_block *newsb); 1356 struct super_block *newsb);
1357 int (*sb_parse_opts_str)(char *options, struct security_mnt_opts *opts); 1357 int (*sb_parse_opts_str)(char *options, struct security_mnt_opts *opts);
1358 int (*dentry_init_security)(struct dentry *dentry, int mode, 1358 int (*dentry_init_security)(struct dentry *dentry, int mode,
1359 struct qstr *name, void **ctx, 1359 const struct qstr *name, void **ctx,
1360 u32 *ctxlen); 1360 u32 *ctxlen);
1361 1361
1362 1362
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5bcbbe511be6..7cc0deee5bde 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1532,7 +1532,7 @@ struct nfs_rpc_ops {
1532 struct nfs_fattr *, struct nfs4_label *); 1532 struct nfs_fattr *, struct nfs4_label *);
1533 int (*setattr) (struct dentry *, struct nfs_fattr *, 1533 int (*setattr) (struct dentry *, struct nfs_fattr *,
1534 struct iattr *); 1534 struct iattr *);
1535 int (*lookup) (struct inode *, struct qstr *, 1535 int (*lookup) (struct inode *, const struct qstr *,
1536 struct nfs_fh *, struct nfs_fattr *, 1536 struct nfs_fh *, struct nfs_fattr *,
1537 struct nfs4_label *); 1537 struct nfs4_label *);
1538 int (*access) (struct inode *, struct nfs_access_entry *); 1538 int (*access) (struct inode *, struct nfs_access_entry *);
@@ -1540,18 +1540,18 @@ struct nfs_rpc_ops {
1540 unsigned int); 1540 unsigned int);
1541 int (*create) (struct inode *, struct dentry *, 1541 int (*create) (struct inode *, struct dentry *,
1542 struct iattr *, int); 1542 struct iattr *, int);
1543 int (*remove) (struct inode *, struct qstr *); 1543 int (*remove) (struct inode *, const struct qstr *);
1544 void (*unlink_setup) (struct rpc_message *, struct inode *dir); 1544 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
1545 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *); 1545 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
1546 int (*unlink_done) (struct rpc_task *, struct inode *); 1546 int (*unlink_done) (struct rpc_task *, struct inode *);
1547 void (*rename_setup) (struct rpc_message *msg, struct inode *dir); 1547 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
1548 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *); 1548 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
1549 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir); 1549 int (*rename_done) (struct rpc_task *task, struct inode *old_dir, struct inode *new_dir);
1550 int (*link) (struct inode *, struct inode *, struct qstr *); 1550 int (*link) (struct inode *, struct inode *, const struct qstr *);
1551 int (*symlink) (struct inode *, struct dentry *, struct page *, 1551 int (*symlink) (struct inode *, struct dentry *, struct page *,
1552 unsigned int, struct iattr *); 1552 unsigned int, struct iattr *);
1553 int (*mkdir) (struct inode *, struct dentry *, struct iattr *); 1553 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1554 int (*rmdir) (struct inode *, struct qstr *); 1554 int (*rmdir) (struct inode *, const struct qstr *);
1555 int (*readdir) (struct dentry *, struct rpc_cred *, 1555 int (*readdir) (struct dentry *, struct rpc_cred *,
1556 u64, struct page **, unsigned int, int); 1556 u64, struct page **, unsigned int, int);
1557 int (*mknod) (struct inode *, struct dentry *, struct iattr *, 1557 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
diff --git a/include/linux/security.h b/include/linux/security.h
index 14df373ff2ca..7831cd57bcf7 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,
240 struct super_block *newsb); 240 struct super_block *newsb);
241int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts); 241int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
242int security_dentry_init_security(struct dentry *dentry, int mode, 242int security_dentry_init_security(struct dentry *dentry, int mode,
243 struct qstr *name, void **ctx, 243 const struct qstr *name, void **ctx,
244 u32 *ctxlen); 244 u32 *ctxlen);
245 245
246int security_inode_alloc(struct inode *inode); 246int security_inode_alloc(struct inode *inode);
@@ -591,7 +591,7 @@ static inline void security_inode_free(struct inode *inode)
591 591
592static inline int security_dentry_init_security(struct dentry *dentry, 592static inline int security_dentry_init_security(struct dentry *dentry,
593 int mode, 593 int mode,
594 struct qstr *name, 594 const struct qstr *name,
595 void **ctx, 595 void **ctx,
596 u32 *ctxlen) 596 u32 *ctxlen)
597{ 597{
diff --git a/security/security.c b/security/security.c
index c4bb47db30ee..4838e7fefa1f 100644
--- a/security/security.c
+++ b/security/security.c
@@ -356,7 +356,7 @@ void security_inode_free(struct inode *inode)
356} 356}
357 357
358int security_dentry_init_security(struct dentry *dentry, int mode, 358int security_dentry_init_security(struct dentry *dentry, int mode,
359 struct qstr *name, void **ctx, 359 const struct qstr *name, void **ctx,
360 u32 *ctxlen) 360 u32 *ctxlen)
361{ 361{
362 return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode, 362 return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode,
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c
index ec30880c4b98..13185a6c266a 100644
--- a/security/selinux/hooks.c
+++ b/security/selinux/hooks.c
@@ -2832,7 +2832,7 @@ static void selinux_inode_free_security(struct inode *inode)
2832} 2832}
2833 2833
2834static int selinux_dentry_init_security(struct dentry *dentry, int mode, 2834static int selinux_dentry_init_security(struct dentry *dentry, int mode,
2835 struct qstr *name, void **ctx, 2835 const struct qstr *name, void **ctx,
2836 u32 *ctxlen) 2836 u32 *ctxlen)
2837{ 2837{
2838 u32 newsid; 2838 u32 newsid;