diff options
author | Jan Blunck <jblunck@suse.de> | 2008-02-14 22:38:36 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-15 00:17:08 -0500 |
commit | 448678a0f3cdd0157f00e98bd337e32030273637 (patch) | |
tree | 12b4fb7875dd500b1923d3eec316db4c1e1a3692 /drivers | |
parent | 3dcd25f37cfe2943beca93f41f50994108248a60 (diff) |
d_path: Make get_dcookie() use a struct path argument
get_dcookie() is always called with a dentry and a vfsmount from a struct
path. Make get_dcookie() take it directly as an argument.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Acked-by: Christoph Hellwig <hch@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: "J. Bruce Fields" <bfields@fieldses.org>
Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/oprofile/buffer_sync.c | 21 |
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). */ |
195 | static inline unsigned long fast_get_dcookie(struct dentry * dentry, | 195 | static 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 { |