lkml.org 
[lkml]   [1999]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectis make_pages_present() what I was looking for?
Hello people,

Recently I needed some way of attacking the classical problem of walking a
spinlock-protected linked list while copying some node data to userspace.

A minute ago I noticed email from Scott Henry <scotth@sgi.com> asking
about map_user_kiobuf() and looking in the relevant source code I found
make_pages_present() which seems to be exactly what I wanted.

Can someone confirm that it is valid to do something like this:

if (make_pages_present(uaddr, uaddr + count))
return -EFAULT;
lock a spinlock
while (walking linked list) {
examine the data and, if needed __copy_to_user(uaddr, kaddr, size)
}
unlock a spinlock

But if that works why isn't it done in the places that need it?

Thanks in advance,
------
Tigran A. Aivazian | http://www.sco.com
Escalations Research Group | tel: +44-(0)1923-813796
Santa Cruz Operation Ltd | http://www.ocston.org/~tigran


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.872 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site