Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs updates from Al Viro: "All kinds of stuff this time around; some more notable parts: - RCU'd vfsmounts handling - new primitives for coredump handling - files_lock is gone - Bruce's delegations handling series - exportfs fixes plus misc stuff all over the place" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (101 commits) ecryptfs: ->f_op is never NULL locks: break delegations on any attribute modification locks: break delegations on link locks: break delegations on rename locks: helper functions for delegation breaking locks: break delegations on unlink namei: minor vfs_unlink cleanup locks: implement delegations locks: introduce new FL_DELEG lock flag vfs: take i_mutex on renamed file vfs: rename I_MUTEX_QUOTA now that it's not used for quotas vfs: don't use PARENT/CHILD lock classes for non-directories vfs: pull ext4's double-i_mutex-locking into common code exportfs: fix quadratic behavior in filehandle lookup exportfs: better variable name exportfs: move most of reconnect_path to helper function exportfs: eliminate unused "noprogress" counter exportfs: stop retrying once we race with rename/remove exportfs: clear DISCONNECTED on all parents sooner exportfs: more detailed comment for path_reconnect ...
这个提交包含在:
@@ -473,7 +473,7 @@ err:
|
||||
static void cuse_fc_release(struct fuse_conn *fc)
|
||||
{
|
||||
struct cuse_conn *cc = fc_to_cc(fc);
|
||||
kfree(cc);
|
||||
kfree_rcu(cc, fc.rcu);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -342,24 +342,6 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, struct qstr *name,
|
||||
return err;
|
||||
}
|
||||
|
||||
static struct dentry *fuse_materialise_dentry(struct dentry *dentry,
|
||||
struct inode *inode)
|
||||
{
|
||||
struct dentry *newent;
|
||||
|
||||
if (inode && S_ISDIR(inode->i_mode)) {
|
||||
struct fuse_conn *fc = get_fuse_conn(inode);
|
||||
|
||||
mutex_lock(&fc->inst_mutex);
|
||||
newent = d_materialise_unique(dentry, inode);
|
||||
mutex_unlock(&fc->inst_mutex);
|
||||
} else {
|
||||
newent = d_materialise_unique(dentry, inode);
|
||||
}
|
||||
|
||||
return newent;
|
||||
}
|
||||
|
||||
static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
|
||||
unsigned int flags)
|
||||
{
|
||||
@@ -382,7 +364,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
|
||||
if (inode && get_node_id(inode) == FUSE_ROOT_ID)
|
||||
goto out_iput;
|
||||
|
||||
newent = fuse_materialise_dentry(entry, inode);
|
||||
newent = d_materialise_unique(entry, inode);
|
||||
err = PTR_ERR(newent);
|
||||
if (IS_ERR(newent))
|
||||
goto out_err;
|
||||
@@ -601,21 +583,9 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
|
||||
}
|
||||
kfree(forget);
|
||||
|
||||
if (S_ISDIR(inode->i_mode)) {
|
||||
struct dentry *alias;
|
||||
mutex_lock(&fc->inst_mutex);
|
||||
alias = d_find_alias(inode);
|
||||
if (alias) {
|
||||
/* New directory must have moved since mkdir */
|
||||
mutex_unlock(&fc->inst_mutex);
|
||||
dput(alias);
|
||||
iput(inode);
|
||||
return -EBUSY;
|
||||
}
|
||||
d_instantiate(entry, inode);
|
||||
mutex_unlock(&fc->inst_mutex);
|
||||
} else
|
||||
d_instantiate(entry, inode);
|
||||
err = d_instantiate_no_diralias(entry, inode);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
fuse_change_entry_timeout(entry, &outarg);
|
||||
fuse_invalidate_attr(dir);
|
||||
@@ -1284,7 +1254,7 @@ static int fuse_direntplus_link(struct file *file,
|
||||
if (!inode)
|
||||
goto out;
|
||||
|
||||
alias = fuse_materialise_dentry(dentry, inode);
|
||||
alias = d_materialise_unique(dentry, inode);
|
||||
err = PTR_ERR(alias);
|
||||
if (IS_ERR(alias))
|
||||
goto out;
|
||||
|
@@ -375,12 +375,11 @@ struct fuse_conn {
|
||||
/** Lock protecting accessess to members of this structure */
|
||||
spinlock_t lock;
|
||||
|
||||
/** Mutex protecting against directory alias creation */
|
||||
struct mutex inst_mutex;
|
||||
|
||||
/** Refcount */
|
||||
atomic_t count;
|
||||
|
||||
struct rcu_head rcu;
|
||||
|
||||
/** The user id for this mount */
|
||||
kuid_t user_id;
|
||||
|
||||
|
@@ -565,7 +565,6 @@ void fuse_conn_init(struct fuse_conn *fc)
|
||||
{
|
||||
memset(fc, 0, sizeof(*fc));
|
||||
spin_lock_init(&fc->lock);
|
||||
mutex_init(&fc->inst_mutex);
|
||||
init_rwsem(&fc->killsb);
|
||||
atomic_set(&fc->count, 1);
|
||||
init_waitqueue_head(&fc->waitq);
|
||||
@@ -596,7 +595,6 @@ void fuse_conn_put(struct fuse_conn *fc)
|
||||
if (atomic_dec_and_test(&fc->count)) {
|
||||
if (fc->destroy_req)
|
||||
fuse_request_free(fc->destroy_req);
|
||||
mutex_destroy(&fc->inst_mutex);
|
||||
fc->release(fc);
|
||||
}
|
||||
}
|
||||
@@ -920,7 +918,7 @@ static void fuse_send_init(struct fuse_conn *fc, struct fuse_req *req)
|
||||
|
||||
static void fuse_free_conn(struct fuse_conn *fc)
|
||||
{
|
||||
kfree(fc);
|
||||
kfree_rcu(fc, rcu);
|
||||
}
|
||||
|
||||
static int fuse_bdi_init(struct fuse_conn *fc, struct super_block *sb)
|
||||
|
在新工单中引用
屏蔽一个用户