diff options
author | Rajesh Venkatasubramanian <vrajesh@umich.edu> | 2004-08-22 22:57:07 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-08-22 22:57:07 -0700 |
commit | 86de37f0de2be6b0c51c0210dd6533177353f864 (patch) | |
tree | b0b20494f4b84df74d8ef79c7ec1d40b1e907566 /fs | |
parent | e66c6753333b9c2b1cf5daf0b73814b5fdb09c41 (diff) | |
download | history-86de37f0de2be6b0c51c0210dd6533177353f864.tar.gz |
[PATCH] prio_tree: iterator + vma_prio_tree_next cleanup
Currently we have:
while ((vma = vma_prio_tree_next(vma, root, &iter,
begin, end)) != NULL)
do_something_with(vma);
Then iter,root,begin,end are all transfered unchanged to various functions.
This patch hides them in struct iter instead.
It slightly lessens source, code size, and stack usage. Patch compiles and
tested lightly.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Rajesh Venkatasubramanian <vrajesh@umich.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/hugetlbfs/inode.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 4ec4283159ea11..90c07ffb7800a3 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -272,11 +272,10 @@ static void hugetlbfs_drop_inode(struct inode *inode) static inline void hugetlb_vmtruncate_list(struct prio_tree_root *root, unsigned long h_pgoff) { - struct vm_area_struct *vma = NULL; + struct vm_area_struct *vma; struct prio_tree_iter iter; - while ((vma = vma_prio_tree_next(vma, root, &iter, - h_pgoff, ULONG_MAX)) != NULL) { + vma_prio_tree_foreach(vma, &iter, root, h_pgoff, ULONG_MAX) { unsigned long h_vm_pgoff; unsigned long v_length; unsigned long v_offset; |