Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
[pandora-kernel.git] / drivers / oprofile / buffer_sync.c
index b2e8e49..8134c7e 100644 (file)
@@ -26,7 +26,9 @@
 #include <linux/profile.h>
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/oprofile.h>
+#include <linux/sched.h>
+
 #include "oprofile_stats.h"
 #include "event_buffer.h"
 #include "cpu_buffer.h"
@@ -108,10 +110,10 @@ static int module_load_notify(struct notifier_block * self, unsigned long val, v
                return 0;
 
        /* FIXME: should we process all CPU buffers ? */
-       down(&buffer_sem);
+       mutex_lock(&buffer_mutex);
        add_event_entry(ESCAPE_CODE);
        add_event_entry(MODULE_LOADED_CODE);
-       up(&buffer_sem);
+       mutex_unlock(&buffer_mutex);
 #endif
        return 0;
 }
@@ -220,8 +222,8 @@ static unsigned long get_exec_dcookie(struct mm_struct * mm)
                        continue;
                if (!(vma->vm_flags & VM_EXECUTABLE))
                        continue;
-               cookie = fast_get_dcookie(vma->vm_file->f_dentry,
-                       vma->vm_file->f_vfsmnt);
+               cookie = fast_get_dcookie(vma->vm_file->f_path.dentry,
+                       vma->vm_file->f_path.mnt);
                break;
        }
 
@@ -246,8 +248,8 @@ static unsigned long lookup_dcookie(struct mm_struct * mm, unsigned long addr, o
                        continue;
 
                if (vma->vm_file) {
-                       cookie = fast_get_dcookie(vma->vm_file->f_dentry,
-                               vma->vm_file->f_vfsmnt);
+                       cookie = fast_get_dcookie(vma->vm_file->f_path.dentry,
+                               vma->vm_file->f_path.mnt);
                        *offset = (vma->vm_pgoff << PAGE_SHIFT) + addr -
                                vma->vm_start;
                } else {
@@ -501,7 +503,7 @@ void sync_buffer(int cpu)
        sync_buffer_state state = sb_buffer_start;
        unsigned long available;
 
-       down(&buffer_sem);
+       mutex_lock(&buffer_mutex);
  
        add_cpu_switch(cpu);
 
@@ -550,5 +552,5 @@ void sync_buffer(int cpu)
 
        mark_done(cpu);
 
-       up(&buffer_sem);
+       mutex_unlock(&buffer_mutex);
 }