You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
This commit is contained in:
+1
-2
@@ -2563,7 +2563,7 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
|
||||
struct page *page, void *fsdata)
|
||||
{
|
||||
struct inode *inode = page->mapping->host;
|
||||
struct buffer_head *head = NULL;
|
||||
struct buffer_head *head = fsdata;
|
||||
struct buffer_head *bh;
|
||||
|
||||
if (!PageMappedToDisk(page)) {
|
||||
@@ -2584,7 +2584,6 @@ int nobh_write_end(struct file *file, struct address_space *mapping,
|
||||
unlock_page(page);
|
||||
page_cache_release(page);
|
||||
|
||||
head = fsdata;
|
||||
while (head) {
|
||||
bh = head;
|
||||
head = head->b_this_page;
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ int sysctl_vfs_cache_pressure __read_mostly = 100;
|
||||
EXPORT_SYMBOL_GPL(sysctl_vfs_cache_pressure);
|
||||
|
||||
__cacheline_aligned_in_smp DEFINE_SPINLOCK(dcache_lock);
|
||||
static __cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
|
||||
__cacheline_aligned_in_smp DEFINE_SEQLOCK(rename_lock);
|
||||
|
||||
EXPORT_SYMBOL(dcache_lock);
|
||||
|
||||
|
||||
+1
-1
@@ -413,7 +413,7 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
|
||||
d_move(old_dentry, dentry);
|
||||
fsnotify_move(old_dir->d_inode, new_dir->d_inode, old_name,
|
||||
old_dentry->d_name.name, S_ISDIR(old_dentry->d_inode->i_mode),
|
||||
NULL, old_dentry->d_inode);
|
||||
NULL, old_dentry);
|
||||
fsnotify_oldname_free(old_name);
|
||||
unlock_rename(new_dir, old_dir);
|
||||
dput(dentry);
|
||||
|
||||
@@ -666,6 +666,49 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(inotify_add_watch);
|
||||
|
||||
/**
|
||||
* inotify_clone_watch - put the watch next to existing one
|
||||
* @old: already installed watch
|
||||
* @new: new watch
|
||||
*
|
||||
* Caller must hold the inotify_mutex of inode we are dealing with;
|
||||
* it is expected to remove the old watch before unlocking the inode.
|
||||
*/
|
||||
s32 inotify_clone_watch(struct inotify_watch *old, struct inotify_watch *new)
|
||||
{
|
||||
struct inotify_handle *ih = old->ih;
|
||||
int ret = 0;
|
||||
|
||||
new->mask = old->mask;
|
||||
new->ih = ih;
|
||||
|
||||
mutex_lock(&ih->mutex);
|
||||
|
||||
/* Initialize a new watch */
|
||||
ret = inotify_handle_get_wd(ih, new);
|
||||
if (unlikely(ret))
|
||||
goto out;
|
||||
ret = new->wd;
|
||||
|
||||
get_inotify_handle(ih);
|
||||
|
||||
new->inode = igrab(old->inode);
|
||||
|
||||
list_add(&new->h_list, &ih->watches);
|
||||
list_add(&new->i_list, &old->inode->inotify_watches);
|
||||
out:
|
||||
mutex_unlock(&ih->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void inotify_evict_watch(struct inotify_watch *watch)
|
||||
{
|
||||
get_inotify_watch(watch);
|
||||
mutex_lock(&watch->ih->mutex);
|
||||
inotify_remove_watch_locked(watch->ih, watch);
|
||||
mutex_unlock(&watch->ih->mutex);
|
||||
}
|
||||
|
||||
/**
|
||||
* inotify_rm_wd - remove a watch from an inotify instance
|
||||
* @ih: inotify handle
|
||||
|
||||
+5
-5
@@ -1174,7 +1174,7 @@ static int fastcall do_path_lookup(int dfd, const char *name,
|
||||
out:
|
||||
if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
|
||||
nd->dentry->d_inode))
|
||||
audit_inode(name, nd->dentry->d_inode);
|
||||
audit_inode(name, nd->dentry);
|
||||
out_fail:
|
||||
return retval;
|
||||
|
||||
@@ -1214,7 +1214,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt,
|
||||
retval = path_walk(name, nd);
|
||||
if (unlikely(!retval && !audit_dummy_context() && nd->dentry &&
|
||||
nd->dentry->d_inode))
|
||||
audit_inode(name, nd->dentry->d_inode);
|
||||
audit_inode(name, nd->dentry);
|
||||
|
||||
return retval;
|
||||
|
||||
@@ -1469,7 +1469,7 @@ static int may_delete(struct inode *dir,struct dentry *victim,int isdir)
|
||||
return -ENOENT;
|
||||
|
||||
BUG_ON(victim->d_parent->d_inode != dir);
|
||||
audit_inode_child(victim->d_name.name, victim->d_inode, dir);
|
||||
audit_inode_child(victim->d_name.name, victim, dir);
|
||||
|
||||
error = permission(dir,MAY_WRITE | MAY_EXEC, NULL);
|
||||
if (error)
|
||||
@@ -1783,7 +1783,7 @@ do_last:
|
||||
* It already exists.
|
||||
*/
|
||||
mutex_unlock(&dir->d_inode->i_mutex);
|
||||
audit_inode(pathname, path.dentry->d_inode);
|
||||
audit_inode(pathname, path.dentry);
|
||||
|
||||
error = -EEXIST;
|
||||
if (flag & O_EXCL)
|
||||
@@ -2562,7 +2562,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry,
|
||||
if (!error) {
|
||||
const char *new_name = old_dentry->d_name.name;
|
||||
fsnotify_move(old_dir, new_dir, old_name, new_name, is_dir,
|
||||
new_dentry->d_inode, old_dentry->d_inode);
|
||||
new_dentry->d_inode, old_dentry);
|
||||
}
|
||||
fsnotify_oldname_free(old_name);
|
||||
|
||||
|
||||
+21
-1
@@ -246,7 +246,7 @@ static struct vfsmount *clone_mnt(struct vfsmount *old, struct dentry *root,
|
||||
list_add(&mnt->mnt_slave, &old->mnt_slave_list);
|
||||
mnt->mnt_master = old;
|
||||
CLEAR_MNT_SHARED(mnt);
|
||||
} else {
|
||||
} else if (!(flag & CL_PRIVATE)) {
|
||||
if ((flag & CL_PROPAGATION) || IS_MNT_SHARED(old))
|
||||
list_add(&mnt->mnt_share, &old->mnt_share);
|
||||
if (IS_MNT_SLAVE(old))
|
||||
@@ -746,6 +746,26 @@ Enomem:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
struct vfsmount *collect_mounts(struct vfsmount *mnt, struct dentry *dentry)
|
||||
{
|
||||
struct vfsmount *tree;
|
||||
down_read(&namespace_sem);
|
||||
tree = copy_tree(mnt, dentry, CL_COPY_ALL | CL_PRIVATE);
|
||||
up_read(&namespace_sem);
|
||||
return tree;
|
||||
}
|
||||
|
||||
void drop_collected_mounts(struct vfsmount *mnt)
|
||||
{
|
||||
LIST_HEAD(umount_list);
|
||||
down_read(&namespace_sem);
|
||||
spin_lock(&vfsmount_lock);
|
||||
umount_tree(mnt, 0, &umount_list);
|
||||
spin_unlock(&vfsmount_lock);
|
||||
up_read(&namespace_sem);
|
||||
release_mounts(&umount_list);
|
||||
}
|
||||
|
||||
/*
|
||||
* @source_mnt : mount tree to be attached
|
||||
* @nd : place the mount tree @source_mnt is attached
|
||||
|
||||
@@ -211,6 +211,7 @@ nfs_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
|
||||
nfs_fattr_init(&fattr);
|
||||
dprintk("NFS call create %s\n", dentry->d_name.name);
|
||||
status = rpc_call_sync(NFS_CLIENT(dir), &msg, 0);
|
||||
nfs_mark_for_revalidate(dir);
|
||||
if (status == 0)
|
||||
status = nfs_instantiate(dentry, &fhandle, &fattr);
|
||||
dprintk("NFS reply create: %d\n", status);
|
||||
|
||||
+1
-1
@@ -171,7 +171,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data)
|
||||
if (parent == NULL)
|
||||
goto out_free;
|
||||
dir = parent->d_inode;
|
||||
if (nfs_copy_dname(dentry, data) == 0)
|
||||
if (nfs_copy_dname(dentry, data) != 0)
|
||||
goto out_dput;
|
||||
/* Non-exclusive lock protects against concurrent lookup() calls */
|
||||
spin_lock(&dir->i_lock);
|
||||
|
||||
@@ -569,7 +569,7 @@ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode)
|
||||
dentry = file->f_path.dentry;
|
||||
inode = dentry->d_inode;
|
||||
|
||||
audit_inode(NULL, inode);
|
||||
audit_inode(NULL, dentry);
|
||||
|
||||
err = -EROFS;
|
||||
if (IS_RDONLY(inode))
|
||||
@@ -727,7 +727,7 @@ asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group)
|
||||
goto out;
|
||||
|
||||
dentry = file->f_path.dentry;
|
||||
audit_inode(NULL, dentry->d_inode);
|
||||
audit_inode(NULL, dentry);
|
||||
error = chown_common(dentry, user, group);
|
||||
fput(file);
|
||||
out:
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#define CL_COPY_ALL 0x04
|
||||
#define CL_MAKE_SHARED 0x08
|
||||
#define CL_PROPAGATION 0x10
|
||||
#define CL_PRIVATE 0x20
|
||||
|
||||
static inline void set_mnt_shared(struct vfsmount *mnt)
|
||||
{
|
||||
|
||||
+4
-4
@@ -267,7 +267,7 @@ sys_fsetxattr(int fd, char __user *name, void __user *value,
|
||||
if (!f)
|
||||
return error;
|
||||
dentry = f->f_path.dentry;
|
||||
audit_inode(NULL, dentry->d_inode);
|
||||
audit_inode(NULL, dentry);
|
||||
error = setxattr(dentry, name, value, size, flags);
|
||||
fput(f);
|
||||
return error;
|
||||
@@ -349,7 +349,7 @@ sys_fgetxattr(int fd, char __user *name, void __user *value, size_t size)
|
||||
f = fget(fd);
|
||||
if (!f)
|
||||
return error;
|
||||
audit_inode(NULL, f->f_path.dentry->d_inode);
|
||||
audit_inode(NULL, f->f_path.dentry);
|
||||
error = getxattr(f->f_path.dentry, name, value, size);
|
||||
fput(f);
|
||||
return error;
|
||||
@@ -422,7 +422,7 @@ sys_flistxattr(int fd, char __user *list, size_t size)
|
||||
f = fget(fd);
|
||||
if (!f)
|
||||
return error;
|
||||
audit_inode(NULL, f->f_path.dentry->d_inode);
|
||||
audit_inode(NULL, f->f_path.dentry);
|
||||
error = listxattr(f->f_path.dentry, list, size);
|
||||
fput(f);
|
||||
return error;
|
||||
@@ -485,7 +485,7 @@ sys_fremovexattr(int fd, char __user *name)
|
||||
if (!f)
|
||||
return error;
|
||||
dentry = f->f_path.dentry;
|
||||
audit_inode(NULL, dentry->d_inode);
|
||||
audit_inode(NULL, dentry);
|
||||
error = removexattr(dentry, name);
|
||||
fput(f);
|
||||
return error;
|
||||
|
||||
Reference in New Issue
Block a user