* because we cannot reach this code without at least one
* dcookie user still being registered (namely, the reader
* of the event buffer). */
-static inline unsigned long fast_get_dcookie(struct dentry * dentry,
+static inline u32 fast_get_dcookie(struct dentry * dentry,
struct vfsmount * vfsmnt)
{
- unsigned long cookie;
+ u32 cookie;
if (dentry->d_cookie)
- return (unsigned long)dentry;
+ return (u32)dentry;
get_dcookie(dentry, vfsmnt, &cookie);
return cookie;
}
* not strictly necessary but allows oprofile to associate
* shared-library samples with particular applications
*/
-static unsigned long get_exec_dcookie(struct mm_struct * mm)
+static u32 get_exec_dcookie(struct mm_struct * mm)
{
- unsigned long cookie = 0;
+ u32 cookie = 0;
struct vm_area_struct * vma;
if (!mm)
* sure to do this lookup before a mm->mmap modification happens so
* we don't lose track.
*/
-static unsigned long lookup_dcookie(struct mm_struct * mm, unsigned long addr, off_t * offset)
+static u32 lookup_dcookie(struct mm_struct * mm, unsigned long addr, off_t * offset)
{
- unsigned long cookie = 0;
+ u32 cookie = 0;
struct vm_area_struct * vma;
for (vma = find_vma(mm, addr); vma; vma = vma->vm_next) {
}
-static unsigned long last_cookie = ~0UL;
+static u32 last_cookie = ~0UL;
static void add_cpu_switch(int i)
{
}
-static void add_ctx_switch(pid_t pid, unsigned long cookie)
+static void add_ctx_switch(pid_t pid, u32 cookie)
{
add_event_entry(ESCAPE_CODE);
add_event_entry(CTX_SWITCH_CODE);
}
-static void add_cookie_switch(unsigned long cookie)
+static void add_cookie_switch(u32 cookie)
{
add_event_entry(ESCAPE_CODE);
add_event_entry(COOKIE_SWITCH_CODE);
static void add_us_sample(struct mm_struct * mm, struct op_sample * s)
{
- unsigned long cookie;
+ u32 cookie;
off_t offset;
cookie = lookup_dcookie(mm, s->eip, &offset);
{
struct mm_struct * mm = 0;
struct task_struct * new;
- unsigned long cookie;
+ u32 cookie;
int i;
for (i=0; i < cpu_buf->pos; ++i) {
* non-transitory that can be processed at a later date.
* This is done by locking the dentry/vfsmnt pair in the
* kernel until released by the tasks needing the persistent
- * objects. The tag is simply an unsigned long that refers
+ * objects. The tag is simply an u32 that refers
* to the pair and can be looked up from userspace.
*/
/* The dentry is locked, its address will do for the cookie */
-static inline unsigned long dcookie_value(struct dcookie_struct * dcs)
+static inline u32 dcookie_value(struct dcookie_struct * dcs)
{
- return (unsigned long)dcs->dentry;
+ return (u32)dcs->dentry;
}
-static size_t dcookie_hash(unsigned long dcookie)
+static size_t dcookie_hash(u32 dcookie)
{
return (dcookie >> 2) & (hash_size - 1);
}
-static struct dcookie_struct * find_dcookie(unsigned long dcookie)
+static struct dcookie_struct * find_dcookie(u32 dcookie)
{
struct dcookie_struct * found = 0;
struct dcookie_struct * dcs;
* value for a dentry/vfsmnt pair.
*/
int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
- unsigned long * cookie)
+ u32 * cookie)
{
int err = 0;
struct dcookie_struct * dcs;
/* And here is where the userspace process can look up the cookie value
* to retrieve the path.
*/
-asmlinkage int sys_lookup_dcookie(unsigned long cookie, char * buf, size_t len)
+asmlinkage int sys_lookup_dcookie(u32 cookie, char * buf, size_t len)
{
char * kbuf;
char * path;
* Returns 0 on success, with *cookie filled in
*/
int get_dcookie(struct dentry * dentry, struct vfsmount * vfsmnt,
- unsigned long * cookie);
+ u32 * cookie);
#else
}
static inline int get_dcookie(struct dentry * dentry,
- struct vfsmount * vfsmnt, unsigned long * cookie)
+ struct vfsmount * vfsmnt, u32 * cookie)
{
return -ENOSYS;
}