Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "The big thing in this pile is Eric's unmount-on-rmdir series; we finally have everything we need for that. The final piece of prereqs is delayed mntput() - now filesystem shutdown always happens on shallow stack. Other than that, we have several new primitives for iov_iter (Matt Wilcox, culled from his XIP-related series) pushing the conversion to ->read_iter()/ ->write_iter() a bit more, a bunch of fs/dcache.c cleanups and fixes (including the external name refcounting, which gives consistent behaviour of d_move() wrt procfs symlinks for long and short names alike) and assorted cleanups and fixes all over the place. This is just the first pile; there's a lot of stuff from various people that ought to go in this window. Starting with unionmount/overlayfs mess... ;-/" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (60 commits) fs/file_table.c: Update alloc_file() comment vfs: Deduplicate code shared by xattr system calls operating on paths reiserfs: remove pointless forward declaration of struct nameidata don't need that forward declaration of struct nameidata in dcache.h anymore take dname_external() into fs/dcache.c let path_init() failures treated the same way as subsequent link_path_walk() fix misuses of f_count() in ppp and netlink ncpfs: use list_for_each_entry() for d_subdirs walk vfs: move getname() from callers to do_mount() gfs2_atomic_open(): skip lookups on hashed dentry [infiniband] remove pointless assignments gadgetfs: saner API for gadgetfs_create_file() f_fs: saner API for ffs_sb_create_file() jfs: don't hash direct inode [s390] remove pointless assignment of ->f_op in vmlogrdr ->open() ecryptfs: ->f_op is never NULL android: ->f_op is never NULL nouveau: __iomem misannotations missing annotation in fs/file.c fs: namespace: suppress 'may be used uninitialized' warnings ...
This commit is contained in:
@@ -198,7 +198,6 @@ struct ep_data {
|
||||
struct list_head epfiles;
|
||||
wait_queue_head_t wait;
|
||||
struct dentry *dentry;
|
||||
struct inode *inode;
|
||||
};
|
||||
|
||||
static inline void get_ep (struct ep_data *data)
|
||||
@@ -1618,10 +1617,9 @@ static void destroy_ep_files (struct dev_data *dev)
|
||||
}
|
||||
|
||||
|
||||
static struct inode *
|
||||
static struct dentry *
|
||||
gadgetfs_create_file (struct super_block *sb, char const *name,
|
||||
void *data, const struct file_operations *fops,
|
||||
struct dentry **dentry_p);
|
||||
void *data, const struct file_operations *fops);
|
||||
|
||||
static int activate_ep_files (struct dev_data *dev)
|
||||
{
|
||||
@@ -1649,10 +1647,9 @@ static int activate_ep_files (struct dev_data *dev)
|
||||
if (!data->req)
|
||||
goto enomem1;
|
||||
|
||||
data->inode = gadgetfs_create_file (dev->sb, data->name,
|
||||
data, &ep_config_operations,
|
||||
&data->dentry);
|
||||
if (!data->inode)
|
||||
data->dentry = gadgetfs_create_file (dev->sb, data->name,
|
||||
data, &ep_config_operations);
|
||||
if (!data->dentry)
|
||||
goto enomem2;
|
||||
list_add_tail (&data->epfiles, &dev->epfiles);
|
||||
}
|
||||
@@ -2012,10 +2009,9 @@ gadgetfs_make_inode (struct super_block *sb,
|
||||
/* creates in fs root directory, so non-renamable and non-linkable.
|
||||
* so inode and dentry are paired, until device reconfig.
|
||||
*/
|
||||
static struct inode *
|
||||
static struct dentry *
|
||||
gadgetfs_create_file (struct super_block *sb, char const *name,
|
||||
void *data, const struct file_operations *fops,
|
||||
struct dentry **dentry_p)
|
||||
void *data, const struct file_operations *fops)
|
||||
{
|
||||
struct dentry *dentry;
|
||||
struct inode *inode;
|
||||
@@ -2031,8 +2027,7 @@ gadgetfs_create_file (struct super_block *sb, char const *name,
|
||||
return NULL;
|
||||
}
|
||||
d_add (dentry, inode);
|
||||
*dentry_p = dentry;
|
||||
return inode;
|
||||
return dentry;
|
||||
}
|
||||
|
||||
static const struct super_operations gadget_fs_operations = {
|
||||
@@ -2080,9 +2075,8 @@ gadgetfs_fill_super (struct super_block *sb, void *opts, int silent)
|
||||
goto Enomem;
|
||||
|
||||
dev->sb = sb;
|
||||
if (!gadgetfs_create_file (sb, CHIP,
|
||||
dev, &dev_init_operations,
|
||||
&dev->dentry)) {
|
||||
dev->dentry = gadgetfs_create_file(sb, CHIP, dev, &dev_init_operations);
|
||||
if (!dev->dentry) {
|
||||
put_dev(dev);
|
||||
goto Enomem;
|
||||
}
|
||||
|
Reference in New Issue
Block a user