runtime/proc_fs_compatibility.h - systemtap
Functions defined
Macros defined
Source code
#ifndef _STP_PROC_FS_COMPATIBILITY_H_
#define _STP_PROC_FS_COMPATIBILITY_H_
#include <linux/proc_fs.h>
#ifndef STAPCONF_PDE_DATA
#ifndef STAPCONF_LINUX_UIDGID_H
static void proc_set_user(struct proc_dir_entry *de, uid_t uid, gid_t gid)
{
de->uid = uid;
de->gid = gid;
}
#else
static void proc_set_user(struct proc_dir_entry *de, kuid_t uid, kgid_t gid)
{
de->uid = __kuid_val(uid);
de->gid = __kgid_val(gid);
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
#define LAST_ENTRY_COUNT 0
#else
#define LAST_ENTRY_COUNT 1
#endif
static void proc_remove(struct proc_dir_entry *de)
{
if (de && de->subdir == NULL) {
if (atomic_read(&de->count) != LAST_ENTRY_COUNT)
printk(KERN_ERR "Removal of %s from /proc"
" is deferred until it is no longer in use.\n"
"Systemtap module removal will block.\n",
de->name);
remove_proc_entry(de->name, de->parent);
}
}
#ifndef STAPCONF_PROC_CREATE_DATA
static struct proc_dir_entry *
proc_create_data(const char *name, umode_t mode,
struct proc_dir_entry *parent,
const struct file_operations *proc_fops, void *data)
{
struct proc_dir_entry *de;
de = proc_create(name, mode, parent, proc_fops);
if (de)
de->data = data;
return de;
}
#endif
#define PDE_DATA(inode) (PDE(inode)->data)
#endif
#endif