aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/perfmon.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/ia64/kernel/perfmon.c
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'arch/ia64/kernel/perfmon.c')
-rw-r--r--arch/ia64/kernel/perfmon.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index cce050e85c73..89accc626b86 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -617,17 +617,19 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
617 return get_unmapped_area(file, addr, len, pgoff, flags); 617 return get_unmapped_area(file, addr, len, pgoff, flags);
618} 618}
619 619
620/* forward declaration */
621static const struct dentry_operations pfmfs_dentry_operations;
620 622
621static int 623static struct dentry *
622pfmfs_get_sb(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, 624pfmfs_mount(struct file_system_type *fs_type, int flags, const char *dev_name, void *data)
623 struct vfsmount *mnt)
624{ 625{
625 return get_sb_pseudo(fs_type, "pfm:", NULL, PFMFS_MAGIC, mnt); 626 return mount_pseudo(fs_type, "pfm:", NULL, &pfmfs_dentry_operations,
627 PFMFS_MAGIC);
626} 628}
627 629
628static struct file_system_type pfm_fs_type = { 630static struct file_system_type pfm_fs_type = {
629 .name = "pfmfs", 631 .name = "pfmfs",
630 .get_sb = pfmfs_get_sb, 632 .mount = pfmfs_mount,
631 .kill_sb = kill_anon_super, 633 .kill_sb = kill_anon_super,
632}; 634};
633 635
@@ -830,10 +832,9 @@ pfm_rvmalloc(unsigned long size)
830 unsigned long addr; 832 unsigned long addr;
831 833
832 size = PAGE_ALIGN(size); 834 size = PAGE_ALIGN(size);
833 mem = vmalloc(size); 835 mem = vzalloc(size);
834 if (mem) { 836 if (mem) {
835 //printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem); 837 //printk("perfmon: CPU%d pfm_rvmalloc(%ld)=%p\n", smp_processor_id(), size, mem);
836 memset(mem, 0, size);
837 addr = (unsigned long)mem; 838 addr = (unsigned long)mem;
838 while (size > 0) { 839 while (size > 0) {
839 pfm_reserve_page(addr); 840 pfm_reserve_page(addr);
@@ -1543,7 +1544,7 @@ pfm_exit_smpl_buffer(pfm_buffer_fmt_t *fmt)
1543 * any operations on the root directory. However, we need a non-trivial 1544 * any operations on the root directory. However, we need a non-trivial
1544 * d_name - pfm: will go nicely and kill the special-casing in procfs. 1545 * d_name - pfm: will go nicely and kill the special-casing in procfs.
1545 */ 1546 */
1546static struct vfsmount *pfmfs_mnt; 1547static struct vfsmount *pfmfs_mnt __read_mostly;
1547 1548
1548static int __init 1549static int __init
1549init_pfm_fs(void) 1550init_pfm_fs(void)
@@ -1573,7 +1574,7 @@ pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos)
1573 return -EINVAL; 1574 return -EINVAL;
1574 } 1575 }
1575 1576
1576 ctx = (pfm_context_t *)filp->private_data; 1577 ctx = filp->private_data;
1577 if (ctx == NULL) { 1578 if (ctx == NULL) {
1578 printk(KERN_ERR "perfmon: pfm_read: NULL ctx [%d]\n", task_pid_nr(current)); 1579 printk(KERN_ERR "perfmon: pfm_read: NULL ctx [%d]\n", task_pid_nr(current));
1579 return -EINVAL; 1580 return -EINVAL;
@@ -1673,7 +1674,7 @@ pfm_poll(struct file *filp, poll_table * wait)
1673 return 0; 1674 return 0;
1674 } 1675 }
1675 1676
1676 ctx = (pfm_context_t *)filp->private_data; 1677 ctx = filp->private_data;
1677 if (ctx == NULL) { 1678 if (ctx == NULL) {
1678 printk(KERN_ERR "perfmon: pfm_poll: NULL ctx [%d]\n", task_pid_nr(current)); 1679 printk(KERN_ERR "perfmon: pfm_poll: NULL ctx [%d]\n", task_pid_nr(current));
1679 return 0; 1680 return 0;
@@ -1733,7 +1734,7 @@ pfm_fasync(int fd, struct file *filp, int on)
1733 return -EBADF; 1734 return -EBADF;
1734 } 1735 }
1735 1736
1736 ctx = (pfm_context_t *)filp->private_data; 1737 ctx = filp->private_data;
1737 if (ctx == NULL) { 1738 if (ctx == NULL) {
1738 printk(KERN_ERR "perfmon: pfm_fasync NULL ctx [%d]\n", task_pid_nr(current)); 1739 printk(KERN_ERR "perfmon: pfm_fasync NULL ctx [%d]\n", task_pid_nr(current));
1739 return -EBADF; 1740 return -EBADF;
@@ -1841,7 +1842,7 @@ pfm_flush(struct file *filp, fl_owner_t id)
1841 return -EBADF; 1842 return -EBADF;
1842 } 1843 }
1843 1844
1844 ctx = (pfm_context_t *)filp->private_data; 1845 ctx = filp->private_data;
1845 if (ctx == NULL) { 1846 if (ctx == NULL) {
1846 printk(KERN_ERR "perfmon: pfm_flush: NULL ctx [%d]\n", task_pid_nr(current)); 1847 printk(KERN_ERR "perfmon: pfm_flush: NULL ctx [%d]\n", task_pid_nr(current));
1847 return -EBADF; 1848 return -EBADF;
@@ -1984,7 +1985,7 @@ pfm_close(struct inode *inode, struct file *filp)
1984 return -EBADF; 1985 return -EBADF;
1985 } 1986 }
1986 1987
1987 ctx = (pfm_context_t *)filp->private_data; 1988 ctx = filp->private_data;
1988 if (ctx == NULL) { 1989 if (ctx == NULL) {
1989 printk(KERN_ERR "perfmon: pfm_close: NULL ctx [%d]\n", task_pid_nr(current)); 1990 printk(KERN_ERR "perfmon: pfm_close: NULL ctx [%d]\n", task_pid_nr(current));
1990 return -EBADF; 1991 return -EBADF;
@@ -2186,7 +2187,7 @@ static const struct file_operations pfm_file_ops = {
2186}; 2187};
2187 2188
2188static int 2189static int
2189pfmfs_delete_dentry(struct dentry *dentry) 2190pfmfs_delete_dentry(const struct dentry *dentry)
2190{ 2191{
2191 return 1; 2192 return 1;
2192} 2193}
@@ -2234,7 +2235,6 @@ pfm_alloc_file(pfm_context_t *ctx)
2234 } 2235 }
2235 path.mnt = mntget(pfmfs_mnt); 2236 path.mnt = mntget(pfmfs_mnt);
2236 2237
2237 path.dentry->d_op = &pfmfs_dentry_operations;
2238 d_add(path.dentry, inode); 2238 d_add(path.dentry, inode);
2239 2239
2240 file = alloc_file(&path, FMODE_READ, &pfm_file_ops); 2240 file = alloc_file(&path, FMODE_READ, &pfm_file_ops);
@@ -4907,7 +4907,7 @@ restart_args:
4907 goto error_args; 4907 goto error_args;
4908 } 4908 }
4909 4909
4910 ctx = (pfm_context_t *)file->private_data; 4910 ctx = file->private_data;
4911 if (unlikely(ctx == NULL)) { 4911 if (unlikely(ctx == NULL)) {
4912 DPRINT(("no context for fd %d\n", fd)); 4912 DPRINT(("no context for fd %d\n", fd));
4913 goto error_args; 4913 goto error_args;