From: Linus Torvalds Date: Sat, 6 Aug 2016 13:49:02 +0000 (-0400) Subject: Merge branch 'work.const-qstr' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=835c92d43b29eb354abdbd5475308a474d7efdfa;p=linux.git Merge branch 'work.const-qstr' of git://git./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 --- 835c92d43b29eb354abdbd5475308a474d7efdfa diff --cc fs/f2fs/dir.c index a485f68a76b11,3b095a35aa471..9054aeac80152 --- a/fs/f2fs/dir.c +++ b/fs/f2fs/dir.c @@@ -267,13 -259,25 +267,13 @@@ out struct f2fs_dir_entry *f2fs_parent_dir(struct inode *dir, struct page **p) { - struct page *page; - struct f2fs_dir_entry *de; - struct f2fs_dentry_block *dentry_blk; - - if (f2fs_has_inline_dentry(dir)) - return f2fs_parent_inline_dir(dir, p); - - page = get_lock_data_page(dir, 0, false); - if (IS_ERR(page)) - return NULL; + struct qstr dotdot = QSTR_INIT("..", 2); - dentry_blk = kmap(page); - de = &dentry_blk->dentry[1]; - *p = page; - unlock_page(page); - return de; + return f2fs_find_entry(dir, &dotdot, p); } - ino_t f2fs_inode_by_name(struct inode *dir, struct qstr *qstr, -ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr) ++ino_t f2fs_inode_by_name(struct inode *dir, const struct qstr *qstr, + struct page **page) { ino_t res = 0; struct f2fs_dir_entry *de; diff --cc fs/f2fs/f2fs.h index 7890e9071499c,fd0a156d75614..675fa79d86f65 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@@ -1913,11 -1804,11 +1913,11 @@@ struct page *init_inode_metadata(struc const struct qstr *, struct page *); void update_parent_metadata(struct inode *, struct inode *, unsigned int); int room_for_filename(const void *, int, int); -void f2fs_drop_nlink(struct inode *, struct inode *, struct page *); +void f2fs_drop_nlink(struct inode *, struct inode *); - struct f2fs_dir_entry *f2fs_find_entry(struct inode *, struct qstr *, + struct f2fs_dir_entry *f2fs_find_entry(struct inode *, const struct qstr *, struct page **); struct f2fs_dir_entry *f2fs_parent_dir(struct inode *, struct page **); - ino_t f2fs_inode_by_name(struct inode *, struct qstr *, struct page **); -ino_t f2fs_inode_by_name(struct inode *, const struct qstr *); ++ino_t f2fs_inode_by_name(struct inode *, const struct qstr *, struct page **); void f2fs_set_link(struct inode *, struct f2fs_dir_entry *, struct page *, struct inode *); int update_dent_inode(struct inode *, struct inode *, const struct qstr *); diff --cc fs/logfs/dir.c index bcd754d216bd1,438b7c516fd6a..9568064ecadf2 --- a/fs/logfs/dir.c +++ b/fs/logfs/dir.c @@@ -156,10 -156,10 +156,10 @@@ static pgoff_t hash_index(u32 hash, in static struct page *logfs_get_dd_page(struct inode *dir, struct dentry *dentry) { - struct qstr *name = &dentry->d_name; + const struct qstr *name = &dentry->d_name; struct page *page; struct logfs_disk_dentry *dd; - u32 hash = hash_32(name->name, name->len, 0); + u32 hash = logfs_hash_32(name->name, name->len, 0); pgoff_t index; int round;