History

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

Linus Torvalds committed 10 years ago

Commit 835c92d2 parents ce804bf 19a6d8937 files · +95 −100Browse files

Unified · Split

37 files
  1. drivers/staging/lustre/lustre/llite/statahead.c +2 −2
  2. fs/adfs/dir.c +2 −2
  3. fs/autofs4/root.c +4 −4
  4. fs/autofs4/waitq.c +2 −2
  5. fs/dcache.c +2 −2
  6. fs/ext2/dir.c +3 −3
  7. fs/ext2/ext2.h +2 −2
  8. fs/f2fs/dir.c +2 −2
  9. fs/f2fs/f2fs.h +2 −2
  10. fs/fat/namei_vfat.c +3 −3
  11. fs/fuse/dir.c +2 −2
  12. fs/fuse/fuse_i.h +1 −1
  13. fs/fuse/inode.c +2 −6
  14. fs/hfs/catalog.c +6 −6
  15. fs/hfs/hfs_fs.h +7 −7
  16. fs/hfs/inode.c +1 −1
  17. fs/hfs/trans.c +1 −1
  18. fs/hfsplus/catalog.c +6 −6
  19. fs/hfsplus/hfsplus_fs.h +5 −5
  20. fs/logfs/dir.c +2 −2
  21. fs/nfs/nfs3proc.c +4 −4
  22. fs/nfs/nfs4_fs.h +3 −2
  23. fs/nfs/nfs4namespace.c +2 −2
  24. fs/nfs/nfs4proc.c +8 −8
  25. fs/nfs/proc.c +4 −4
  26. fs/nfs/unlink.c +1 −1
  27. fs/ocfs2/dlm/dlmdomain.c +1 −3
  28. fs/ocfs2/dlmfs/dlmfs.c +2 −2
  29. fs/ocfs2/dlmfs/userdlm.c +1 −1
  30. fs/ocfs2/dlmfs/userdlm.h +1 −1
  31. fs/proc/proc_sysctl.c +1 −1
  32. include/linux/dcache.h +1 −1
  33. include/linux/lsm_hooks.h +1 −1
  34. include/linux/nfs_xdr.h +4 −4
  35. include/linux/security.h +2 −2
  36. security/security.c +1 −1
  37. security/selinux/hooks.c +1 −1
drivers/staging/lustre/lustre/llite/statahead.c+2−2
@@ -781,7 +781,7 @@ static int sa_args_init(struct inode *dir, struct inode *child, · 780 unmodified lines
781781 struct ll_sa_entry *entry, struct md_enqueue_info **pmi,
782782 struct ldlm_enqueue_info **pei)
783783 {
784− struct qstr *qstr = &entry->se_qstr;
784+ const struct qstr *qstr = &entry->se_qstr;
785785 struct ll_inode_info *lli = ll_i2info(dir);
786786 struct md_enqueue_info *minfo;
787787 struct ldlm_enqueue_info *einfo;
@@ -1340,7 +1340,7 @@ enum { · 552 unmodified lines
13401340 static int is_first_dirent(struct inode *dir, struct dentry *dentry)
13411341 {
13421342 struct ll_dir_chain chain;
1343− struct qstr *target = &dentry->d_name;
1343+ const struct qstr *target = &dentry->d_name;
13441344 struct page *page;
13451345 __u64 pos = 0;
13461346 int dot_de;
fs/adfs/dir.c+2−2
@@ -101,7 +101,7 @@ out: · 100 unmodified lines
101101 }
102102
103103 static int
104−adfs_match(struct qstr *name, struct object_info *obj)
104+adfs_match(const struct qstr *name, struct object_info *obj)
105105 {
106106 int i;
107107
@@ -126,7 +126,7 @@ adfs_match(struct qstr *name, struct object_info *obj) · 18 unmodified lines
126126 }
127127
128128 static int
129−adfs_dir_lookup_byname(struct inode *inode, struct qstr *name, struct object_info *obj)
129+adfs_dir_lookup_byname(struct inode *inode, const struct qstr *name, struct object_info *obj)
130130 {
131131 struct super_block *sb = inode->i_sb;
132132 const struct adfs_dir_ops *ops = ADFS_SB(sb)->s_dir;
fs/autofs4/root.c+4−4
@@ -159,7 +159,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry) · 158 unmodified lines
159159 {
160160 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
161161 struct dentry *parent = dentry->d_parent;
162− struct qstr *name = &dentry->d_name;
162+ const struct qstr *name = &dentry->d_name;
163163 unsigned int len = name->len;
164164 unsigned int hash = name->hash;
165165 const unsigned char *str = name->name;
@@ -172,7 +172,7 @@ static struct dentry *autofs4_lookup_active(struct dentry *dentry) · 6 unmodified lines
172172 list_for_each(p, head) {
173173 struct autofs_info *ino;
174174 struct dentry *active;
175− struct qstr *qstr;
175+ const struct qstr *qstr;
176176
177177 ino = list_entry(p, struct autofs_info, active);
178178 active = ino->dentry;
@@ -214,7 +214,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry, · 35 unmodified lines
214214 {
215215 struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb);
216216 struct dentry *parent = dentry->d_parent;
217− struct qstr *name = &dentry->d_name;
217+ const struct qstr *name = &dentry->d_name;
218218 unsigned int len = name->len;
219219 unsigned int hash = name->hash;
220220 const unsigned char *str = name->name;
@@ -227,7 +227,7 @@ static struct dentry *autofs4_lookup_expiring(struct dentry *dentry, · 6 unmodified lines
227227 list_for_each(p, head) {
228228 struct autofs_info *ino;
229229 struct dentry *expiring;
230− struct qstr *qstr;
230+ const struct qstr *qstr;
231231
232232 if (rcu_walk) {
233233 spin_unlock(&sbi->lookup_lock);
fs/autofs4/waitq.c+2−2
@@ -225,7 +225,7 @@ rename_retry: · 224 unmodified lines
225225 }
226226
227227 static struct autofs_wait_queue *
228−autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr)
228+autofs4_find_wait(struct autofs_sb_info *sbi, const struct qstr *qstr)
229229 {
230230 struct autofs_wait_queue *wq;
231231
@@ -249,7 +249,7 @@ autofs4_find_wait(struct autofs_sb_info *sbi, struct qstr *qstr) · 17 unmodified lines
249249 */
250250 static int validate_request(struct autofs_wait_queue **wait,
251251 struct autofs_sb_info *sbi,
252− struct qstr *qstr,
252+ const struct qstr *qstr,
253253 struct dentry *dentry, enum autofs_notify notify)
254254 {
255255 struct autofs_wait_queue *wq;
fs/dcache.c+2−2
@@ -2636,7 +2636,7 @@ EXPORT_SYMBOL(d_exact_alias); · 2635 unmodified lines
26362636 * Parent inode i_mutex must be held over d_lookup and into this call (to
26372637 * keep renames and concurrent inserts, and readdir(2) away).
26382638 */
2639−void dentry_update_name_case(struct dentry *dentry, struct qstr *name)
2639+void dentry_update_name_case(struct dentry *dentry, const struct qstr *name)
26402640 {
26412641 BUG_ON(!inode_is_locked(dentry->d_parent->d_inode));
26422642 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) · 395 unmodified lines
30383038 * Data dependency barrier is needed to make sure that we see that terminating
30393039 * NUL. Alpha strikes again, film at 11...
30403040 */
3041−static int prepend_name(char **buffer, int *buflen, struct qstr *name)
3041+static int prepend_name(char **buffer, int *buflen, const struct qstr *name)
30423042 {
30433043 const char *dname = ACCESS_ONCE(name->name);
30443044 u32 dlen = ACCESS_ONCE(name->len);
fs/ext2/dir.c+3−3
@@ -358,8 +358,8 @@ ext2_readdir(struct file *file, struct dir_context *ctx) · 357 unmodified lines
358358 * and the entry itself. Page is returned mapped and unlocked.
359359 * Entry is guaranteed to be valid.
360360 */
361−struct ext2_dir_entry_2 *ext2_find_entry (struct inode * dir,
362− struct qstr *child, struct page ** res_page)
361+struct ext2_dir_entry_2 *ext2_find_entry (struct inode *dir,
362+ const struct qstr *child, struct page **res_page)
363363 {
364364 const char *name = child->name;
365365 int namelen = child->len;
@@ -435,7 +435,7 @@ struct ext2_dir_entry_2 * ext2_dotdot (struct inode *dir, struct page **p) · 69 unmodified lines
435435 return de;
436436 }
437437
438−ino_t ext2_inode_by_name(struct inode *dir, struct qstr *child)
438+ino_t ext2_inode_by_name(struct inode *dir, const struct qstr *child)
439439 {
440440 ino_t res = 0;
441441 struct ext2_dir_entry_2 *de;
fs/ext2/ext2.h+2−2
@@ -757,9 +757,9 @@ extern void ext2_rsv_window_add(struct super_block *sb, struct ext2_reserve_wind · 756 unmodified lines
757757
758758 /* dir.c */
759759 extern int ext2_add_link (struct dentry *, struct inode *);
760−extern ino_t ext2_inode_by_name(struct inode *, struct qstr *);
760+extern ino_t ext2_inode_by_name(struct inode *, const struct qstr *);
761761 extern int ext2_make_empty(struct inode *, struct inode *);
762−extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,struct qstr *, struct page **);
762+extern struct ext2_dir_entry_2 * ext2_find_entry (struct inode *,const struct qstr *, struct page **);
763763 extern int ext2_delete_entry (struct ext2_dir_entry_2 *, struct page *);
764764 extern int ext2_empty_dir (struct inode *);
765765 extern struct ext2_dir_entry_2 * ext2_dotdot (struct inode *, struct page **);
fs/f2fs/dir.c+2−2
@@ -219,7 +219,7 @@ static struct f2fs_dir_entry *find_in_level(struct inode *dir, · 218 unmodified lines
219219 * Entry is guaranteed to be valid.
220220 */
221221 struct 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)
223223 {
224224 unsigned long npages = dir_blocks(dir);
225225 struct f2fs_dir_entry *de = NULL;
@@ -272,7 +272,7 @@ struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p) · 46 unmodified lines
272272 return f2fs_find_entry(dir, &dotdot, p);
273273 }
274274
275−ino_t f2fs_inode_by_name(struct inode *dir, struct qstr *qstr,
275+ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr,
276276 struct page **page)
277277 {
278278 ino_t res = 0;
fs/f2fs/f2fs.h+2−2
@@ -1914,10 +1914,10 @@ struct page *init_inode_metadata(struct inode *, struct inode *, · 1913 unmodified lines
19141914 void update_parent_metadata(struct inode *, struct inode *, unsigned int);
19151915 int room_for_filename(const void *, int, int);
19161916 void f2fs_drop_nlink(struct inode *, struct inode *);
1917−struct f2fs_dir_entry *f2fs_find_entry(struct inode *, struct qstr *,
1917+struct f2fs_dir_entry *f2fs_find_entry(struct inode *, const struct qstr *,
19181918 struct page **);
19191919 struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **);
1920−ino_t f2fs_inode_by_name(struct inode *, struct qstr *, struct page **);
1920+ino_t f2fs_inode_by_name(struct inode *, const struct qstr *, struct page **);
19211921 void f2fs_set_link(struct inode *, struct f2fs_dir_entry *,
19221922 struct page *, struct inode *);
19231923 int update_dent_inode(struct inode *, struct inode *, const struct qstr *);
fs/fat/namei_vfat.c+3−3
@@ -652,8 +652,8 @@ out_free: · 651 unmodified lines
652652 return err;
653653 }
654654
655−static int vfat_add_entry(struct inode *dir, struct qstr *qname, int is_dir,
656− int cluster, struct timespec *ts,
655+static int vfat_add_entry(struct inode *dir, const struct qstr *qname,
656+ int is_dir, int cluster, struct timespec *ts,
657657 struct fat_slot_info *sinfo)
658658 {
659659 struct msdos_dir_slot *slots;
@@ -688,7 +688,7 @@ cleanup: · 28 unmodified lines
688688 return err;
689689 }
690690
691−static int vfat_find(struct inode *dir, struct qstr *qname,
691+static int vfat_find(struct inode *dir, const struct qstr *qname,
692692 struct fat_slot_info *sinfo)
693693 {
694694 unsigned int len = vfat_striptail_len(qname);
fs/fuse/dir.c+2−2
@@ -146,7 +146,7 @@ static void fuse_invalidate_entry(struct dentry *entry) · 145 unmodified lines
146146 }
147147
148148 static 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,
150150 struct fuse_entry_out *outarg)
151151 {
152152 memset(outarg, 0, sizeof(struct fuse_entry_out));
@@ -282,7 +282,7 @@ int fuse_valid_type(int m) · 129 unmodified lines
282282 S_ISBLK(m) || S_ISFIFO(m) || S_ISSOCK(m);
283283 }
284284
285−int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
285+int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name,
286286 struct fuse_entry_out *outarg, struct inode **inode)
287287 {
288288 struct fuse_conn *fc = get_fuse_conn_super(sb);
fs/fuse/fuse_i.h+1−1
@@ -704,7 +704,7 @@ struct inode *fuse_iget(struct super_block *sb, u64 nodeid, · 703 unmodified lines
704704 int generation, struct fuse_attr *attr,
705705 u64 attr_valid, u64 attr_version);
706706
707−int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
707+int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name,
708708 struct fuse_entry_out *outarg, struct inode **inode);
709709
710710 /**
fs/fuse/inode.c+2−6
@@ -673,13 +673,11 @@ static struct dentry *fuse_get_dentry(struct super_block *sb, · 672 unmodified lines
673673 inode = ilookup5(sb, handle->nodeid, fuse_inode_eq, &handle->nodeid);
674674 if (!inode) {
675675 struct fuse_entry_out outarg;
676− struct qstr name;
676+ const struct qstr name = QSTR_INIT(".", 1);
677677
678678 if (!fc->export_support)
679679 goto out_err;
680680
681− name.len = 1;
682− name.name = ".";
683681 err = fuse_lookup_name(sb, handle->nodeid, &name, &outarg,
684682 &inode);
685683 if (err && err != -ENOENT)
@@ -775,14 +773,12 @@ static struct dentry *fuse_get_parent(struct dentry *child) · 89 unmodified lines
775773 struct inode *inode;
776774 struct dentry *parent;
777775 struct fuse_entry_out outarg;
778− struct qstr name;
776+ const struct qstr name = QSTR_INIT("..", 2);
779777 int err;
780778
781779 if (!fc->export_support)
782780 return ERR_PTR(-ESTALE);
783781
784− name.len = 2;
785− name.name = "..";
786782 err = fuse_lookup_name(child_inode->i_sb, get_node_id(child_inode),
787783 &name, &outarg, &inode);
788784 if (err) {
fs/hfs/catalog.c+6−6
@@ -20,7 +20,7 @@ · 19 unmodified lines
2020 *
2121 * Given the ID of the parent and the name build a search key.
2222 */
23−void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, struct qstr *name)
23+void hfs_cat_build_key(struct super_block *sb, btree_key *key, u32 parent, const struct qstr *name)
2424 {
2525 key->cat.reserved = 0;
2626 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) · 37 unmodified lines
6464
6565 static int hfs_cat_build_thread(struct super_block *sb,
6666 hfs_cat_rec *rec, int type,
67− u32 parentid, struct qstr *name)
67+ u32 parentid, const struct qstr *name)
6868 {
6969 rec->type = type;
7070 memset(rec->thread.reserved, 0, sizeof(rec->thread.reserved));
@@ -79,7 +79,7 @@ static int hfs_cat_build_thread(struct super_block *sb, · 8 unmodified lines
7979 * Add a new file or directory to the catalog B-tree and
8080 * return a (struct hfs_cat_entry) for it in '*result'.
8181 */
82−int hfs_cat_create(u32 cnid, struct inode *dir, struct qstr *str, struct inode *inode)
82+int hfs_cat_create(u32 cnid, struct inode *dir, const struct qstr *str, struct inode *inode)
8383 {
8484 struct hfs_find_data fd;
8585 struct super_block *sb;
@@ -210,7 +210,7 @@ int hfs_cat_find_brec(struct super_block *sb, u32 cnid, · 124 unmodified lines
210210 * Delete the indicated file or directory.
211211 * The associated thread is also removed unless ('with_thread'==0).
212212 */
213−int hfs_cat_delete(u32 cnid, struct inode *dir, struct qstr *str)
213+int hfs_cat_delete(u32 cnid, struct inode *dir, const struct qstr *str)
214214 {
215215 struct super_block *sb;
216216 struct hfs_find_data fd;
@@ -277,8 +277,8 @@ out: · 60 unmodified lines
277277 * If the destination exists it is removed and a
278278 * (struct hfs_cat_entry) for it is returned in '*result'.
279279 */
280−int hfs_cat_move(u32 cnid, struct inode *src_dir, struct qstr *src_name,
281− struct inode *dst_dir, struct qstr *dst_name)
280+int hfs_cat_move(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
281+ struct inode *dst_dir, const struct qstr *dst_name)
282282 {
283283 struct super_block *sb;
284284 struct hfs_find_data src_fd, dst_fd;
fs/hfs/hfs_fs.h+7−7
@@ -178,11 +178,11 @@ extern int hfs_clear_vbm_bits(struct super_block *, u16, u16); · 177 unmodified lines
178178 extern int hfs_cat_keycmp(const btree_key *, const btree_key *);
179179 struct hfs_find_data;
180180 extern int hfs_cat_find_brec(struct super_block *, u32, struct hfs_find_data *);
181−extern int hfs_cat_create(u32, struct inode *, struct qstr *, struct inode *);
182−extern int hfs_cat_delete(u32, struct inode *, struct qstr *);
183−extern int hfs_cat_move(u32, struct inode *, struct qstr *,
184− struct inode *, struct qstr *);
185−extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, struct qstr *);
181+extern int hfs_cat_create(u32, struct inode *, const struct qstr *, struct inode *);
182+extern int hfs_cat_delete(u32, struct inode *, const struct qstr *);
183+extern int hfs_cat_move(u32, struct inode *, const struct qstr *,
184+ struct inode *, const struct qstr *);
185+extern void hfs_cat_build_key(struct super_block *, btree_key *, u32, const struct qstr *);
186186
187187 /* dir.c */
188188 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); · 12 unmodified lines
201201 extern const struct address_space_operations hfs_aops;
202202 extern const struct address_space_operations hfs_btree_aops;
203203
204−extern struct inode *hfs_new_inode(struct inode *, struct qstr *, umode_t);
204+extern struct inode *hfs_new_inode(struct inode *, const struct qstr *, umode_t);
205205 extern void hfs_inode_write_fork(struct inode *, struct hfs_extent *, __be32 *, __be32 *);
206206 extern int hfs_write_inode(struct inode *, struct writeback_control *);
207207 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 * · 29 unmodified lines
237237 unsigned int len, const char *str, const struct qstr *name);
238238
239239 /* trans.c */
240−extern void hfs_asc2mac(struct super_block *, struct hfs_name *, struct qstr *);
240+extern void hfs_asc2mac(struct super_block *, struct hfs_name *, const struct qstr *);
241241 extern int hfs_mac2asc(struct super_block *, char *, const struct hfs_name *);
242242
243243 /* super.c */
fs/hfs/inode.c+1−1
@@ -177,7 +177,7 @@ const struct address_space_operations hfs_aops = { · 176 unmodified lines
177177 /*
178178 * hfs_new_inode
179179 */
180−struct inode *hfs_new_inode(struct inode *dir, struct qstr *name, umode_t mode)
180+struct inode *hfs_new_inode(struct inode *dir, const struct qstr *name, umode_t mode)
181181 {
182182 struct super_block *sb = dir->i_sb;
183183 struct inode *inode = new_inode(sb);
fs/hfs/trans.c+1−1
@@ -94,7 +94,7 @@ out: · 93 unmodified lines
9494 * This routine is a inverse to hfs_mac2triv().
9595 * A ':' is replaced by a '/'.
9696 */
97−void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, struct qstr *in)
97+void hfs_asc2mac(struct super_block *sb, struct hfs_name *out, const struct qstr *in)
9898 {
9999 struct nls_table *nls_disk = HFS_SB(sb)->nls_disk;
100100 struct nls_table *nls_io = HFS_SB(sb)->nls_io;
fs/hfsplus/catalog.c+6−6
@@ -40,7 +40,7 @@ int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1, · 39 unmodified lines
4040
4141 /* Generates key for catalog file/folders record. */
4242 int 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)
4444 {
4545 int len, err;
4646
@@ -174,7 +174,7 @@ static int hfsplus_cat_build_record(hfsplus_cat_entry *entry, · 127 unmodified lines
174174
175175 static int hfsplus_fill_cat_thread(struct super_block *sb,
176176 hfsplus_cat_entry *entry, int type,
177− u32 parentid, struct qstr *str)
177+ u32 parentid, const struct qstr *str)
178178 {
179179 int err;
180180
@@ -250,7 +250,7 @@ static void hfsplus_subfolders_dec(struct inode *dir) · 69 unmodified lines
250250 }
251251
252252 int hfsplus_create_cat(u32 cnid, struct inode *dir,
253− struct qstr *str, struct inode *inode)
253+ const struct qstr *str, struct inode *inode)
254254 {
255255 struct super_block *sb = dir->i_sb;
256256 struct hfs_find_data fd;
@@ -318,7 +318,7 @@ err2: · 61 unmodified lines
318318 return err;
319319 }
320320
321−int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str)
321+int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str)
322322 {
323323 struct super_block *sb = dir->i_sb;
324324 struct hfs_find_data fd;
@@ -415,8 +415,8 @@ out: · 90 unmodified lines
415415 }
416416
417417 int hfsplus_rename_cat(u32 cnid,
418− struct inode *src_dir, struct qstr *src_name,
419− struct inode *dst_dir, struct qstr *dst_name)
418+ struct inode *src_dir, const struct qstr *src_name,
419+ struct inode *dst_dir, const struct qstr *dst_name)
420420 {
421421 struct super_block *sb = src_dir->i_sb;
422422 struct hfs_find_data src_fd, dst_fd;
fs/hfsplus/hfsplus_fs.h+5−5
@@ -445,17 +445,17 @@ int hfsplus_cat_case_cmp_key(const hfsplus_btree_key *k1, · 444 unmodified lines
445445 int hfsplus_cat_bin_cmp_key(const hfsplus_btree_key *k1,
446446 const hfsplus_btree_key *k2);
447447 int 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);
449449 void hfsplus_cat_build_key_with_cnid(struct super_block *sb,
450450 hfsplus_btree_key *key, u32 parent);
451451 void hfsplus_cat_set_perms(struct inode *inode, struct hfsplus_perm *perms);
452452 int hfsplus_find_cat(struct super_block *sb, u32 cnid,
453453 struct hfs_find_data *fd);
454−int hfsplus_create_cat(u32 cnid, struct inode *dir, struct qstr *str,
454+int hfsplus_create_cat(u32 cnid, struct inode *dir, const struct qstr *str,
455455 struct inode *inode);
456−int hfsplus_delete_cat(u32 cnid, struct inode *dir, struct qstr *str);
457−int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, struct qstr *src_name,
458− struct inode *dst_dir, struct qstr *dst_name);
456+int hfsplus_delete_cat(u32 cnid, struct inode *dir, const struct qstr *str);
457+int hfsplus_rename_cat(u32 cnid, struct inode *src_dir, const struct qstr *src_name,
458+ struct inode *dst_dir, const struct qstr *dst_name);
459459
460460 /* dir.c */
461461 extern const struct inode_operations hfsplus_dir_inode_operations;
fs/logfs/dir.c+2−2
@@ -156,7 +156,7 @@ static pgoff_t hash_index(u32 hash, int round) · 155 unmodified lines
156156
157157 static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry)
158158 {
159− struct qstr *name = &dentry->d_name;
159+ const struct qstr *name = &dentry->d_name;
160160 struct page *page;
161161 struct logfs_disk_dentry *dd;
162162 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) · 160 unmodified lines
323323 return 0;
324324 }
325325
326−static void logfs_set_name(struct logfs_disk_dentry *dd, struct qstr *name)
326+static void logfs_set_name(struct logfs_disk_dentry *dd, const struct qstr *name)
327327 {
328328 dd->namelen = cpu_to_be16(name->len);
329329 memcpy(dd->name, name->name, name->len);
fs/nfs/nfs3proc.c+4−4
@@ -144,7 +144,7 @@ nfs3_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, · 143 unmodified lines
144144 }
145145
146146 static int
147−nfs3_proc_lookup(struct inode *dir, struct qstr *name,
147+nfs3_proc_lookup(struct inode *dir, const struct qstr *name,
148148 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
149149 struct nfs4_label *label)
150150 {
@@ -404,7 +404,7 @@ out: · 253 unmodified lines
404404 }
405405
406406 static int
407−nfs3_proc_remove(struct inode *dir, struct qstr *name)
407+nfs3_proc_remove(struct inode *dir, const struct qstr *name)
408408 {
409409 struct nfs_removeargs arg = {
410410 .fh = NFS_FH(dir),
@@ -480,7 +480,7 @@ nfs3_proc_rename_done(struct rpc_task *task, struct inode *old_dir, · 69 unmodified lines
480480 }
481481
482482 static int
483−nfs3_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
483+nfs3_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
484484 {
485485 struct nfs3_linkargs arg = {
486486 .fromfh = NFS_FH(inode),
@@ -582,7 +582,7 @@ out: · 95 unmodified lines
582582 }
583583
584584 static int
585−nfs3_proc_rmdir(struct inode *dir, struct qstr *name)
585+nfs3_proc_rmdir(struct inode *dir, const struct qstr *name)
586586 {
587587 struct nfs_fattr *dir_attr;
588588 struct nfs3_diropargs arg = {
fs/nfs/nfs4_fs.h+3−2
@@ -225,7 +225,8 @@ int nfs_atomic_open(struct inode *, struct dentry *, struct file *, · 224 unmodified lines
225225 extern struct file_system_type nfs4_fs_type;
226226
227227 /* nfs4namespace.c */
228−struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *, struct qstr *);
228+struct rpc_clnt *nfs4_negotiate_security(struct rpc_clnt *, struct inode *,
229+ const struct qstr *);
229230 struct vfsmount *nfs4_submount(struct nfs_server *, struct dentry *,
230231 struct nfs_fh *, struct nfs_fattr *);
231232 int nfs4_replace_transport(struct nfs_server *server,
@@ -252,7 +253,7 @@ extern int nfs4_proc_fs_locations(struct rpc_clnt *, struct inode *, const struc · 20 unmodified lines
252253 extern int nfs4_proc_get_locations(struct inode *, struct nfs4_fs_locations *,
253254 struct page *page, struct rpc_cred *);
254255 extern int nfs4_proc_fsid_present(struct inode *, struct rpc_cred *);
255−extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, struct qstr *,
256+extern struct rpc_clnt *nfs4_proc_lookup_mountpoint(struct inode *, const struct qstr *,
256257 struct nfs_fh *, struct nfs_fattr *);
257258 extern int nfs4_proc_secinfo(struct inode *, const struct qstr *, struct nfs4_secinfo_flavors *);
258259 extern const struct xattr_handler *nfs4_xattr_handlers[];
fs/nfs/nfs4namespace.c+2−2
@@ -208,7 +208,7 @@ static struct rpc_clnt *nfs_find_best_sec(struct rpc_clnt *clnt, · 207 unmodified lines
208208 */
209209 struct rpc_clnt *
210210 nfs4_negotiate_security(struct rpc_clnt *clnt, struct inode *inode,
211− struct qstr *name)
211+ const struct qstr *name)
212212 {
213213 struct page *page;
214214 struct nfs4_secinfo_flavors *flavors;
@@ -397,7 +397,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry, · 182 unmodified lines
397397 rpc_authflavor_t flavor = server->client->cl_auth->au_flavor;
398398 struct dentry *parent = dget_parent(dentry);
399399 struct inode *dir = d_inode(parent);
400− struct qstr *name = &dentry->d_name;
400+ const struct qstr *name = &dentry->d_name;
401401 struct rpc_clnt *client;
402402 struct vfsmount *mnt;
403403
fs/nfs/nfs4proc.c+8−8
@@ -3538,7 +3538,7 @@ static void nfs_fixup_secinfo_attributes(struct nfs_fattr *fattr) · 3537 unmodified lines
35383538 }
35393539
35403540 static 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,
35423542 struct nfs_fattr *fattr, struct nfs4_label *label)
35433543 {
35443544 struct nfs4_exception exception = { };
@@ -3580,7 +3580,7 @@ out: · 35 unmodified lines
35803580 return err;
35813581 }
35823582
3583−static int nfs4_proc_lookup(struct inode *dir, struct qstr *name,
3583+static int nfs4_proc_lookup(struct inode *dir, const struct qstr *name,
35843584 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
35853585 struct nfs4_label *label)
35863586 {
@@ -3596,7 +3596,7 @@ static int nfs4_proc_lookup(struct inode *dir, struct qstr *name, · 9 unmodified lines
35963596 }
35973597
35983598 struct rpc_clnt *
3599−nfs4_proc_lookup_mountpoint(struct inode *dir, struct qstr *name,
3599+nfs4_proc_lookup_mountpoint(struct inode *dir, const struct qstr *name,
36003600 struct nfs_fh *fhandle, struct nfs_fattr *fattr)
36013601 {
36023602 struct rpc_clnt *client = NFS_CLIENT(dir);
@@ -3755,7 +3755,7 @@ out: · 152 unmodified lines
37553755 return status;
37563756 }
37573757
3758−static int _nfs4_proc_remove(struct inode *dir, struct qstr *name)
3758+static int _nfs4_proc_remove(struct inode *dir, const struct qstr *name)
37593759 {
37603760 struct nfs_server *server = NFS_SERVER(dir);
37613761 struct nfs_removeargs args = {
@@ -3778,7 +3778,7 @@ static int _nfs4_proc_remove(struct inode *dir, struct qstr *name) · 16 unmodified lines
37783778 return status;
37793779 }
37803780
3781−static int nfs4_proc_remove(struct inode *dir, struct qstr *name)
3781+static int nfs4_proc_remove(struct inode *dir, const struct qstr *name)
37823782 {
37833783 struct nfs4_exception exception = { };
37843784 int err;
@@ -3861,7 +3861,7 @@ static int nfs4_proc_rename_done(struct rpc_task *task, struct inode *old_dir, · 76 unmodified lines
38613861 return 1;
38623862 }
38633863
3864−static int _nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
3864+static int _nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
38653865 {
38663866 struct nfs_server *server = NFS_SERVER(inode);
38673867 struct nfs4_link_arg arg = {
@@ -3908,7 +3908,7 @@ out: · 40 unmodified lines
39083908 return status;
39093909 }
39103910
3911−static int nfs4_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
3911+static int nfs4_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
39123912 {
39133913 struct nfs4_exception exception = { };
39143914 int err;
@@ -3930,7 +3930,7 @@ struct nfs4_createdata { · 15 unmodified lines
39303930 };
39313931
39323932 static 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)
39343934 {
39353935 struct nfs4_createdata *data;
39363936
fs/nfs/proc.c+4−4
@@ -145,7 +145,7 @@ nfs_proc_setattr(struct dentry *dentry, struct nfs_fattr *fattr, · 144 unmodified lines
145145 }
146146
147147 static int
148−nfs_proc_lookup(struct inode *dir, struct qstr *name,
148+nfs_proc_lookup(struct inode *dir, const struct qstr *name,
149149 struct nfs_fh *fhandle, struct nfs_fattr *fattr,
150150 struct nfs4_label *label)
151151 {
@@ -299,7 +299,7 @@ out: · 147 unmodified lines
299299 }
300300
301301 static int
302−nfs_proc_remove(struct inode *dir, struct qstr *name)
302+nfs_proc_remove(struct inode *dir, const struct qstr *name)
303303 {
304304 struct nfs_removeargs arg = {
305305 .fh = NFS_FH(dir),
@@ -357,7 +357,7 @@ nfs_proc_rename_done(struct rpc_task *task, struct inode *old_dir, · 51 unmodified lines
357357 }
358358
359359 static int
360−nfs_proc_link(struct inode *inode, struct inode *dir, struct qstr *name)
360+nfs_proc_link(struct inode *inode, struct inode *dir, const struct qstr *name)
361361 {
362362 struct nfs_linkargs arg = {
363363 .fromfh = NFS_FH(inode),
@@ -456,7 +456,7 @@ out: · 92 unmodified lines
456456 }
457457
458458 static int
459−nfs_proc_rmdir(struct inode *dir, struct qstr *name)
459+nfs_proc_rmdir(struct inode *dir, const struct qstr *name)
460460 {
461461 struct nfs_diropargs arg = {
462462 .fh = NFS_FH(dir),
fs/nfs/unlink.c+1−1
@@ -162,7 +162,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) · 161 unmodified lines
162162 * @dentry: dentry to unlink
163163 */
164164 static int
165−nfs_async_unlink(struct dentry *dentry, struct qstr *name)
165+nfs_async_unlink(struct dentry *dentry, const struct qstr *name)
166166 {
167167 struct nfs_unlinkdata *data;
168168 int status = -ENOMEM;
fs/ocfs2/dlm/dlmdomain.c+1−3
@@ -172,12 +172,10 @@ void __dlm_unhash_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) · 171 unmodified lines
172172 void __dlm_insert_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
173173 {
174174 struct hlist_head *bucket;
175− struct qstr *q;
176175
177176 assert_spin_locked(&dlm->spinlock);
178177
179− q = &res->lockname;
180− bucket = dlm_lockres_hash(dlm, q->hash);
178+ bucket = dlm_lockres_hash(dlm, res->lockname.hash);
181179
182180 /* get a reference for our hashtable */
183181 dlm_lockres_get(res);
fs/ocfs2/dlmfs/dlmfs.c+2−2
@@ -469,7 +469,7 @@ static int dlmfs_mkdir(struct inode * dir, · 468 unmodified lines
469469 {
470470 int status;
471471 struct inode *inode = NULL;
472− struct qstr *domain = &dentry->d_name;
472+ const struct qstr *domain = &dentry->d_name;
473473 struct dlmfs_inode_private *ip;
474474 struct ocfs2_cluster_connection *conn;
475475
@@ -518,7 +518,7 @@ static int dlmfs_create(struct inode *dir, · 42 unmodified lines
518518 {
519519 int status = 0;
520520 struct inode *inode;
521− struct qstr *name = &dentry->d_name;
521+ const struct qstr *name = &dentry->d_name;
522522
523523 mlog(0, "create %.*s\n", name->len, name->name);
524524
fs/ocfs2/dlmfs/userdlm.c+1−1
@@ -667,7 +667,7 @@ void user_dlm_set_locking_protocol(void) · 666 unmodified lines
667667 ocfs2_stack_glue_set_max_proto_version(&user_dlm_lproto.lp_max_version);
668668 }
669669
670−struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name)
670+struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name)
671671 {
672672 int rc;
673673 struct ocfs2_cluster_connection *conn;
fs/ocfs2/dlmfs/userdlm.h+1−1
@@ -83,7 +83,7 @@ void user_dlm_write_lvb(struct inode *inode, · 82 unmodified lines
8383 ssize_t user_dlm_read_lvb(struct inode *inode,
8484 char *val,
8585 unsigned int len);
86−struct ocfs2_cluster_connection *user_dlm_register(struct qstr *name);
86+struct ocfs2_cluster_connection *user_dlm_register(const struct qstr *name);
8787 void user_dlm_unregister(struct ocfs2_cluster_connection *conn);
8888 void user_dlm_set_locking_protocol(void);
8989
fs/proc/proc_sysctl.c+1−1
@@ -474,7 +474,7 @@ static struct dentry *proc_sys_lookup(struct inode *dir, struct dentry *dentry, · 473 unmodified lines
474474 {
475475 struct ctl_table_header *head = grab_header(dir);
476476 struct ctl_table_header *h = NULL;
477− struct qstr *name = &dentry->d_name;
477+ const struct qstr *name = &dentry->d_name;
478478 struct ctl_table *p;
479479 struct inode *inode;
480480 struct dentry *err = ERR_PTR(-ENOENT);
include/linux/dcache.h+1−1
@@ -263,7 +263,7 @@ extern void d_rehash(struct dentry *); · 262 unmodified lines
263263
264264 extern void d_add(struct dentry *, struct inode *);
265265
266−extern void dentry_update_name_case(struct dentry *, struct qstr *);
266+extern void dentry_update_name_case(struct dentry *, const struct qstr *);
267267
268268 /* used for rename() and baskets */
269269 extern void d_move(struct dentry *, struct dentry *);
include/linux/lsm_hooks.h+1−1
@@ -1356,7 +1356,7 @@ union security_list_options { · 1355 unmodified lines
13561356 struct super_block *newsb);
13571357 int (*sb_parse_opts_str)(char *options, struct security_mnt_opts *opts);
13581358 int (*dentry_init_security)(struct dentry *dentry, int mode,
1359− struct qstr *name, void **ctx,
1359+ const struct qstr *name, void **ctx,
13601360 u32 *ctxlen);
13611361
13621362
include/linux/nfs_xdr.h+4−4
@@ -1532,7 +1532,7 @@ struct nfs_rpc_ops { · 1531 unmodified lines
15321532 struct nfs_fattr *, struct nfs4_label *);
15331533 int (*setattr) (struct dentry *, struct nfs_fattr *,
15341534 struct iattr *);
1535− int (*lookup) (struct inode *, struct qstr *,
1535+ int (*lookup) (struct inode *, const struct qstr *,
15361536 struct nfs_fh *, struct nfs_fattr *,
15371537 struct nfs4_label *);
15381538 int (*access) (struct inode *, struct nfs_access_entry *);
@@ -1540,18 +1540,18 @@ struct nfs_rpc_ops { · 1 unmodified line
15401540 unsigned int);
15411541 int (*create) (struct inode *, struct dentry *,
15421542 struct iattr *, int);
1543− int (*remove) (struct inode *, struct qstr *);
1543+ int (*remove) (struct inode *, const struct qstr *);
15441544 void (*unlink_setup) (struct rpc_message *, struct inode *dir);
15451545 void (*unlink_rpc_prepare) (struct rpc_task *, struct nfs_unlinkdata *);
15461546 int (*unlink_done) (struct rpc_task *, struct inode *);
15471547 void (*rename_setup) (struct rpc_message *msg, struct inode *dir);
15481548 void (*rename_rpc_prepare)(struct rpc_task *task, struct nfs_renamedata *);
15491549 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 *);
15511551 int (*symlink) (struct inode *, struct dentry *, struct page *,
15521552 unsigned int, struct iattr *);
15531553 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
1554− int (*rmdir) (struct inode *, struct qstr *);
1554+ int (*rmdir) (struct inode *, const struct qstr *);
15551555 int (*readdir) (struct dentry *, struct rpc_cred *,
15561556 u64, struct page **, unsigned int, int);
15571557 int (*mknod) (struct inode *, struct dentry *, struct iattr *,
include/linux/security.h+2−2
@@ -240,7 +240,7 @@ int security_sb_clone_mnt_opts(const struct super_block *oldsb, · 239 unmodified lines
240240 struct super_block *newsb);
241241 int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
242242 int security_dentry_init_security(struct dentry *dentry, int mode,
243− struct qstr *name, void **ctx,
243+ const struct qstr *name, void **ctx,
244244 u32 *ctxlen);
245245
246246 int security_inode_alloc(struct inode *inode);
@@ -591,7 +591,7 @@ static inline void security_inode_free(struct inode *inode) · 344 unmodified lines
591591
592592 static inline int security_dentry_init_security(struct dentry *dentry,
593593 int mode,
594− struct qstr *name,
594+ const struct qstr *name,
595595 void **ctx,
596596 u32 *ctxlen)
597597 {
security/security.c+1−1
@@ -356,7 +356,7 @@ void security_inode_free(struct inode *inode) · 355 unmodified lines
356356 }
357357
358358 int security_dentry_init_security(struct dentry *dentry, int mode,
359− struct qstr *name, void **ctx,
359+ const struct qstr *name, void **ctx,
360360 u32 *ctxlen)
361361 {
362362 return call_int_hook(dentry_init_security, -EOPNOTSUPP, dentry, mode,
security/selinux/hooks.c+1−1
@@ -2832,7 +2832,7 @@ static void selinux_inode_free_security(struct inode *inode) · 2831 unmodified lines
28322832 }
28332833
28342834 static int selinux_dentry_init_security(struct dentry *dentry, int mode,
2835− struct qstr *name, void **ctx,
2835+ const struct qstr *name, void **ctx,
28362836 u32 *ctxlen)
28372837 {
28382838 u32 newsid;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t