[PATCH] capable/capability.h (arch/)
[pandora-kernel.git] / arch / ia64 / kernel / perfmon.c
index 1650353..c026ac1 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/pagemap.h>
 #include <linux/mount.h>
 #include <linux/bitops.h>
+#include <linux/capability.h>
 #include <linux/rcupdate.h>
 
 #include <asm/errno.h>
@@ -574,7 +575,7 @@ pfm_protect_ctx_ctxsw(pfm_context_t *x)
        return 0UL;
 }
 
-static inline unsigned long
+static inline void
 pfm_unprotect_ctx_ctxsw(pfm_context_t *x, unsigned long f)
 {
        spin_unlock(&(x)->ctx_lock);
@@ -2218,12 +2219,13 @@ static void
 pfm_free_fd(int fd, struct file *file)
 {
        struct files_struct *files = current->files;
-       struct fdtable *fdt = files_fdtable(files);
+       struct fdtable *fdt;
 
        /* 
         * there ie no fd_uninstall(), so we do it here
         */
        spin_lock(&files->file_lock);
+       fdt = files_fdtable(files);
        rcu_assign_pointer(fdt->fd[fd], NULL);
        spin_unlock(&files->file_lock);
 
@@ -2351,7 +2353,8 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
        insert_vm_struct(mm, vma);
 
        mm->total_vm  += size >> PAGE_SHIFT;
-       vm_stat_account(vma);
+       vm_stat_account(vma->vm_mm, vma->vm_flags, vma->vm_file,
+                                                       vma_pages(vma));
        up_write(&task->mm->mmap_sem);
 
        /*
@@ -4938,7 +4941,7 @@ abort_locked:
        if (call_made && PFM_CMD_RW_ARG(cmd) && copy_to_user(arg, args_k, base_sz*count)) ret = -EFAULT;
 
 error_args:
-       if (args_k) kfree(args_k);
+       kfree(args_k);
 
        DPRINT(("cmd=%s ret=%ld\n", PFM_CMD_NAME(cmd), ret));