aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/oprofile/buffer_sync.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-15 13:36:30 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-02-15 13:36:30 -0500
commit52833e897fd8c6f62b3e5e27291fa9bc803f7460 (patch)
treecfe90047ee6c7402674a29ec7258319142b96ff1 /drivers/oprofile/buffer_sync.c
parent8d042218b075de3cdbe066198515b3521553746e (diff)
parent4ee29f6a52158cea526b16a44ae38643946103ec (diff)
Merge branch 'linus_origin' into hotfixes
Diffstat (limited to 'drivers/oprofile/buffer_sync.c')
-rw-r--r--drivers/oprofile/buffer_sync.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/drivers/oprofile/buffer_sync.c b/drivers/oprofile/buffer_sync.c
index 8134c7e198a5..b07ba2a14119 100644
--- a/drivers/oprofile/buffer_sync.c
+++ b/drivers/oprofile/buffer_sync.c
@@ -187,23 +187,22 @@ void sync_stop(void)
187 end_sync(); 187 end_sync();
188} 188}
189 189
190 190
191/* Optimisation. We can manage without taking the dcookie sem 191/* Optimisation. We can manage without taking the dcookie sem
192 * because we cannot reach this code without at least one 192 * because we cannot reach this code without at least one
193 * dcookie user still being registered (namely, the reader 193 * dcookie user still being registered (namely, the reader
194 * of the event buffer). */ 194 * of the event buffer). */
195static inline unsigned long fast_get_dcookie(struct dentry * dentry, 195static inline unsigned long fast_get_dcookie(struct path *path)
196 struct vfsmount * vfsmnt)
197{ 196{
198 unsigned long cookie; 197 unsigned long cookie;
199 198
200 if (dentry->d_cookie) 199 if (path->dentry->d_cookie)
201 return (unsigned long)dentry; 200 return (unsigned long)path->dentry;
202 get_dcookie(dentry, vfsmnt, &cookie); 201 get_dcookie(path, &cookie);
203 return cookie; 202 return cookie;
204} 203}
205 204
206 205
207/* Look up the dcookie for the task's first VM_EXECUTABLE mapping, 206/* Look up the dcookie for the task's first VM_EXECUTABLE mapping,
208 * which corresponds loosely to "application name". This is 207 * which corresponds loosely to "application name". This is
209 * not strictly necessary but allows oprofile to associate 208 * not strictly necessary but allows oprofile to associate
@@ -222,8 +221,7 @@ static unsigned long get_exec_dcookie(struct mm_struct * mm)
222 continue; 221 continue;
223 if (!(vma->vm_flags & VM_EXECUTABLE)) 222 if (!(vma->vm_flags & VM_EXECUTABLE))
224 continue; 223 continue;
225 cookie = fast_get_dcookie(vma->vm_file->f_path.dentry, 224 cookie = fast_get_dcookie(&vma->vm_file->f_path);
226 vma->vm_file->f_path.mnt);
227 break; 225 break;
228 } 226 }
229 227
@@ -248,8 +246,7 @@ static unsigned long lookup_dcookie(struct mm_struct * mm, unsigned long addr, o
248 continue; 246 continue;
249 247
250 if (vma->vm_file) { 248 if (vma->vm_file) {
251 cookie = fast_get_dcookie(vma->vm_file->f_path.dentry, 249 cookie = fast_get_dcookie(&vma->vm_file->f_path);
252 vma->vm_file->f_path.mnt);
253 *offset = (vma->vm_pgoff << PAGE_SHIFT) + addr - 250 *offset = (vma->vm_pgoff << PAGE_SHIFT) + addr -
254 vma->vm_start; 251 vma->vm_start;
255 } else { 252 } else {