Skip to content

Commit

Permalink
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/viro/vfs-2.6

* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6: (38 commits)
  direct I/O fallback sync simplification
  ocfs: stop using do_sync_mapping_range
  cleanup blockdev_direct_IO locking
  make generic_acl slightly more generic
  sanitize xattr handler prototypes
  libfs: move EXPORT_SYMBOL for d_alloc_name
  vfs: force reval of target when following LAST_BIND symlinks (try torvalds#7)
  ima: limit imbalance msg
  Untangling ima mess, part 3: kill dead code in ima
  Untangling ima mess, part 2: deal with counters
  Untangling ima mess, part 1: alloc_file()
  O_TRUNC open shouldn't fail after file truncation
  ima: call ima_inode_free ima_inode_free
  IMA: clean up the IMA counts updating code
  ima: only insert at inode creation time
  ima: valid return code from ima_inode_alloc
  fs: move get_empty_filp() deffinition to internal.h
  Sanitize exec_permission_lite()
  Kill cached_lookup() and real_lookup()
  Kill path_lookup_open()
  ...

Trivial conflicts in fs/direct-io.c
  • Loading branch information
torvalds committed Dec 16, 2009
2 parents 529e894 + c05c4ed commit bac5e54
Show file tree
Hide file tree
Showing 81 changed files with 1,172 additions and 1,831 deletions.
15 changes: 8 additions & 7 deletions arch/ia64/kernel/perfmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2200,7 +2200,7 @@ pfm_alloc_file(pfm_context_t *ctx)
{
struct file *file;
struct inode *inode;
struct dentry *dentry;
struct path path;
char name[32];
struct qstr this;

Expand All @@ -2225,18 +2225,19 @@ pfm_alloc_file(pfm_context_t *ctx)
/*
* allocate a new dcache entry
*/
dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this);
if (!dentry) {
path.dentry = d_alloc(pfmfs_mnt->mnt_sb->s_root, &this);
if (!path.dentry) {
iput(inode);
return ERR_PTR(-ENOMEM);
}
path.mnt = mntget(pfmfs_mnt);

dentry->d_op = &pfmfs_dentry_operations;
d_add(dentry, inode);
path.dentry->d_op = &pfmfs_dentry_operations;
d_add(path.dentry, inode);

file = alloc_file(pfmfs_mnt, dentry, FMODE_READ, &pfm_file_ops);
file = alloc_file(&path, FMODE_READ, &pfm_file_ops);
if (!file) {
dput(dentry);
path_put(&path);
return ERR_PTR(-ENFILE);
}

Expand Down
7 changes: 1 addition & 6 deletions arch/parisc/hpux/sys_hpux.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,7 @@ int hpux_getdomainname(char __user *name, int len)

int hpux_pipe(int *kstack_fildes)
{
int error;

lock_kernel();
error = do_pipe_flags(kstack_fildes, 0);
unlock_kernel();
return error;
return do_pipe_flags(kstack_fildes, 0);
}

/* lies - says it works, but it really didn't lock anything */
Expand Down
1 change: 0 additions & 1 deletion arch/x86/include/asm/sys_ia32.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct mmap_arg_struct;
asmlinkage long sys32_mmap(struct mmap_arg_struct __user *);
asmlinkage long sys32_mprotect(unsigned long, size_t, unsigned long);

asmlinkage long sys32_pipe(int __user *);
struct sigaction32;
struct old_sigaction32;
asmlinkage long sys32_rt_sigaction(int, struct sigaction32 __user *,
Expand Down
1 change: 0 additions & 1 deletion arch/xtensa/include/asm/syscall.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ struct pt_regs;
struct sigaction;
asmlinkage long xtensa_execve(char*, char**, char**, struct pt_regs*);
asmlinkage long xtensa_clone(unsigned long, unsigned long, struct pt_regs*);
asmlinkage long xtensa_pipe(int __user *);
asmlinkage long xtensa_ptrace(long, long, long, long);
asmlinkage long xtensa_sigreturn(struct pt_regs*);
asmlinkage long xtensa_rt_sigreturn(struct pt_regs*);
Expand Down
2 changes: 1 addition & 1 deletion arch/xtensa/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ __SYSCALL( 35, sys_readlink, 3)
#define __NR_mknod 36
__SYSCALL( 36, sys_mknod, 3)
#define __NR_pipe 37
__SYSCALL( 37, xtensa_pipe, 1)
__SYSCALL( 37, sys_pipe, 1)
#define __NR_unlink 38
__SYSCALL( 38, sys_unlink, 1)
#define __NR_rmdir 39
Expand Down
18 changes: 0 additions & 18 deletions arch/xtensa/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,6 @@ syscall_t sys_call_table[__NR_syscall_count] /* FIXME __cacheline_aligned */= {
#include <asm/unistd.h>
};

/*
* xtensa_pipe() is the normal C calling standard for creating a pipe. It's not
* the way unix traditional does this, though.
*/

asmlinkage long xtensa_pipe(int __user *userfds)
{
int fd[2];
int error;

error = do_pipe_flags(fd, 0);
if (!error) {
if (copy_to_user(userfds, fd, 2 * sizeof(int)))
error = -EFAULT;
}
return error;
}

asmlinkage long xtensa_shmat(int shmid, char __user *shmaddr, int shmflg)
{
unsigned long ret;
Expand Down
9 changes: 7 additions & 2 deletions drivers/infiniband/core/uverbs_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,7 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
int is_async, int *fd)
{
struct ib_uverbs_event_file *ev_file;
struct path path;
struct file *filp;
int ret;

Expand Down Expand Up @@ -519,8 +520,10 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
* system call on a uverbs file, which will already have a
* module reference.
*/
filp = alloc_file(uverbs_event_mnt, dget(uverbs_event_mnt->mnt_root),
FMODE_READ, fops_get(&uverbs_event_fops));
path.mnt = uverbs_event_mnt;
path.dentry = uverbs_event_mnt->mnt_root;
path_get(&path);
filp = alloc_file(&path, FMODE_READ, fops_get(&uverbs_event_fops));
if (!filp) {
ret = -ENFILE;
goto err_fd;
Expand All @@ -531,6 +534,8 @@ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
return filp;

err_fd:
fops_put(&uverbs_event_fops);
path_put(&path);
put_unused_fd(*fd);

err:
Expand Down
46 changes: 5 additions & 41 deletions drivers/staging/dst/dcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ static void dst_node_cleanup(struct dst_node *n)

if (n->bdev) {
sync_blockdev(n->bdev);
blkdev_put(n->bdev, FMODE_READ|FMODE_WRITE);
close_bdev_exclusive(n->bdev, FMODE_READ|FMODE_WRITE);
}

dst_state_lock(st);
Expand Down Expand Up @@ -463,37 +463,6 @@ void dst_node_put(struct dst_node *n)
}
}

/*
* This function finds devices major/minor numbers for given pathname.
*/
static int dst_lookup_device(const char *path, dev_t *dev)
{
int err;
struct nameidata nd;
struct inode *inode;

err = path_lookup(path, LOOKUP_FOLLOW, &nd);
if (err)
return err;

inode = nd.path.dentry->d_inode;
if (!inode) {
err = -ENOENT;
goto out;
}

if (!S_ISBLK(inode->i_mode)) {
err = -ENOTBLK;
goto out;
}

*dev = inode->i_rdev;

out:
path_put(&nd.path);
return err;
}

/*
* Setting up export device: lookup by the name, get its size
* and setup listening socket, which will accept clients, which
Expand All @@ -503,17 +472,12 @@ static int dst_setup_export(struct dst_node *n, struct dst_ctl *ctl,
struct dst_export_ctl *le)
{
int err;
dev_t dev = 0; /* gcc likes to scream here */

snprintf(n->info->local, sizeof(n->info->local), "%s", le->device);

err = dst_lookup_device(le->device, &dev);
if (err)
return err;

n->bdev = open_by_devnum(dev, FMODE_READ|FMODE_WRITE);
if (!n->bdev)
return -ENODEV;
n->bdev = open_bdev_exclusive(le->device, FMODE_READ|FMODE_WRITE, NULL);
if (IS_ERR(n->bdev))
return PTR_ERR(n->bdev);

if (n->size != 0)
n->size = min_t(loff_t, n->bdev->bd_inode->i_size, n->size);
Expand All @@ -528,7 +492,7 @@ static int dst_setup_export(struct dst_node *n, struct dst_ctl *ctl,
return 0;

err_out_cleanup:
blkdev_put(n->bdev, FMODE_READ|FMODE_WRITE);
close_bdev_exclusive(n->bdev, FMODE_READ|FMODE_WRITE);
n->bdev = NULL;

return err;
Expand Down
18 changes: 9 additions & 9 deletions fs/anon_inodes.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct file *anon_inode_getfile(const char *name,
void *priv, int flags)
{
struct qstr this;
struct dentry *dentry;
struct path path;
struct file *file;
int error;

Expand All @@ -106,25 +106,25 @@ struct file *anon_inode_getfile(const char *name,
this.name = name;
this.len = strlen(name);
this.hash = 0;
dentry = d_alloc(anon_inode_mnt->mnt_sb->s_root, &this);
if (!dentry)
path.dentry = d_alloc(anon_inode_mnt->mnt_sb->s_root, &this);
if (!path.dentry)
goto err_module;

path.mnt = mntget(anon_inode_mnt);
/*
* We know the anon_inode inode count is always greater than zero,
* so we can avoid doing an igrab() and we can use an open-coded
* atomic_inc().
*/
atomic_inc(&anon_inode_inode->i_count);

dentry->d_op = &anon_inodefs_dentry_operations;
path.dentry->d_op = &anon_inodefs_dentry_operations;
/* Do not publish this dentry inside the global dentry hash table */
dentry->d_flags &= ~DCACHE_UNHASHED;
d_instantiate(dentry, anon_inode_inode);
path.dentry->d_flags &= ~DCACHE_UNHASHED;
d_instantiate(path.dentry, anon_inode_inode);

error = -ENFILE;
file = alloc_file(anon_inode_mnt, dentry,
FMODE_READ | FMODE_WRITE, fops);
file = alloc_file(&path, FMODE_READ | FMODE_WRITE, fops);
if (!file)
goto err_dput;
file->f_mapping = anon_inode_inode->i_mapping;
Expand All @@ -137,7 +137,7 @@ struct file *anon_inode_getfile(const char *name,
return file;

err_dput:
dput(dentry);
path_put(&path);
err_module:
module_put(fops->owner);
return ERR_PTR(error);
Expand Down
47 changes: 12 additions & 35 deletions fs/btrfs/acl.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
return acl;
}

static int btrfs_xattr_get_acl(struct inode *inode, int type,
void *value, size_t size)
static int btrfs_xattr_acl_get(struct dentry *dentry, const char *name,
void *value, size_t size, int type)
{
struct posix_acl *acl;
int ret = 0;

acl = btrfs_get_acl(inode, type);
acl = btrfs_get_acl(dentry->d_inode, type);

if (IS_ERR(acl))
return PTR_ERR(acl);
Expand Down Expand Up @@ -151,8 +151,8 @@ static int btrfs_set_acl(struct inode *inode, struct posix_acl *acl, int type)
return ret;
}

static int btrfs_xattr_set_acl(struct inode *inode, int type,
const void *value, size_t size)
static int btrfs_xattr_acl_set(struct dentry *dentry, const char *name,
const void *value, size_t size, int flags, int type)
{
int ret = 0;
struct posix_acl *acl = NULL;
Expand All @@ -167,38 +167,13 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type,
}
}

ret = btrfs_set_acl(inode, acl, type);
ret = btrfs_set_acl(dentry->d_inode, acl, type);

posix_acl_release(acl);

return ret;
}


static int btrfs_xattr_acl_access_get(struct inode *inode, const char *name,
void *value, size_t size)
{
return btrfs_xattr_get_acl(inode, ACL_TYPE_ACCESS, value, size);
}

static int btrfs_xattr_acl_access_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
return btrfs_xattr_set_acl(inode, ACL_TYPE_ACCESS, value, size);
}

static int btrfs_xattr_acl_default_get(struct inode *inode, const char *name,
void *value, size_t size)
{
return btrfs_xattr_get_acl(inode, ACL_TYPE_DEFAULT, value, size);
}

static int btrfs_xattr_acl_default_set(struct inode *inode, const char *name,
const void *value, size_t size, int flags)
{
return btrfs_xattr_set_acl(inode, ACL_TYPE_DEFAULT, value, size);
}

int btrfs_check_acl(struct inode *inode, int mask)
{
struct posix_acl *acl;
Expand Down Expand Up @@ -303,14 +278,16 @@ int btrfs_acl_chmod(struct inode *inode)

struct xattr_handler btrfs_xattr_acl_default_handler = {
.prefix = POSIX_ACL_XATTR_DEFAULT,
.get = btrfs_xattr_acl_default_get,
.set = btrfs_xattr_acl_default_set,
.flags = ACL_TYPE_DEFAULT,
.get = btrfs_xattr_acl_get,
.set = btrfs_xattr_acl_set,
};

struct xattr_handler btrfs_xattr_acl_access_handler = {
.prefix = POSIX_ACL_XATTR_ACCESS,
.get = btrfs_xattr_acl_access_get,
.set = btrfs_xattr_acl_access_set,
.flags = ACL_TYPE_ACCESS,
.get = btrfs_xattr_acl_get,
.set = btrfs_xattr_acl_set,
};

#else /* CONFIG_BTRFS_FS_POSIX_ACL */
Expand Down
11 changes: 4 additions & 7 deletions fs/cachefiles/bind.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ int cachefiles_daemon_bind(struct cachefiles_cache *cache, char *args)
static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
{
struct cachefiles_object *fsdef;
struct nameidata nd;
struct path path;
struct kstatfs stats;
struct dentry *graveyard, *cachedir, *root;
const struct cred *saved_cred;
Expand Down Expand Up @@ -114,15 +114,12 @@ static int cachefiles_daemon_add_cache(struct cachefiles_cache *cache)
_debug("- fsdef %p", fsdef);

/* look up the directory at the root of the cache */
memset(&nd, 0, sizeof(nd));

ret = path_lookup(cache->rootdirname, LOOKUP_DIRECTORY, &nd);
ret = kern_path(cache->rootdirname, LOOKUP_DIRECTORY, &path);
if (ret < 0)
goto error_open_root;

cache->mnt = mntget(nd.path.mnt);
root = dget(nd.path.dentry);
path_put(&nd.path);
cache->mnt = path.mnt;
root = path.dentry;

/* check parameters */
ret = -EOPNOTSUPP;
Expand Down
2 changes: 0 additions & 2 deletions fs/cachefiles/rdwr.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

#include <linux/mount.h>
#include <linux/file.h>
#include <linux/ima.h>
#include "internal.h"

/*
Expand Down Expand Up @@ -923,7 +922,6 @@ int cachefiles_write_page(struct fscache_storage *op, struct page *page)
if (IS_ERR(file)) {
ret = PTR_ERR(file);
} else {
ima_counts_get(file);
ret = -EIO;
if (file->f_op->write) {
pos = (loff_t) page->index << PAGE_SHIFT;
Expand Down
1 change: 1 addition & 0 deletions fs/dcache.c
Original file line number Diff line number Diff line change
Expand Up @@ -978,6 +978,7 @@ struct dentry *d_alloc_name(struct dentry *parent, const char *name)
q.hash = full_name_hash(q.name, q.len);
return d_alloc(parent, &q);
}
EXPORT_SYMBOL(d_alloc_name);

/* the caller must hold dcache_lock */
static void __d_instantiate(struct dentry *dentry, struct inode *inode)
Expand Down
Loading

0 comments on commit bac5e54

Please sign in to comment.