NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/49335: uvn_findpages(9) is out of sync with the code



>Number:         49335
>Category:       kern
>Synopsis:       uvn_findpages(9) is out of sync with the code
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Oct 29 22:15:00 +0000 2014
>Originator:     Kamil Rytarowski
>Release:        current
>Organization:
>Environment:
NetBSD current
>Description:
Code and documentation are out of sync:

src/sys/uvm/uvm_extern.h

1.67      chs       195: #define UFP_ALL                0x00
                    196: #define UFP_NOWAIT     0x01
                    197: #define UFP_NOALLOC    0x02
                    198: #define UFP_NOCACHE    0x04
                    199: #define UFP_NORDONLY   0x08
                    200: #define UFP_DIRTYONLY  0x10
                    201: #define UFP_BACKWARD   0x20

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/uvm/uvm_extern.h?annotate=1.184.2.1

     uvn_findpages() looks up or creates pages in uobj at offset offset, marks
     them busy and returns them in the pps array.  Currently uobj must be a
     vnode object.  The number of pages requested is pointed to by npagesp,
     and this value is updated with the actual number of pages returned.  The
     flags can be

     #define UFP_ALL         0x00    /* return all pages requested */
     #define UFP_NOWAIT      0x01    /* don't sleep */
     #define UFP_NOALLOC     0x02    /* don't allocate new pages */
     #define UFP_NOCACHE     0x04    /* don't return pages which already exist */
     #define UFP_NORDONLY    0x08    /* don't return PG_READONLY pages */

     UFP_ALL is a pseudo-flag meaning all requested pages should be returned.
     UFP_NOWAIT means that we must not sleep.  UFP_NOALLOC causes any pages
     which do not already exist to be skipped.  UFP_NOCACHE causes any pages
     which do already exist to be skipped.  UFP_NORDONLY causes any pages
     which are marked PG_READONLY to be skipped.

-- man find_pages
>How-To-Repeat:
man uvn_findpages
>Fix:
commit 5b6813f6ddda8bc87460d87df81ccc5de441e2df
Author: Kamil Rytarowski <n54%gmx.com@localhost>
Date:   Wed Oct 29 23:01:00 2014 +0100

    Describe UFP_DIRTYONLY and UFP_BACKWARD as valid flag values of uvn_findpages(9)

diff --git a/man/man9/uvm.9 b/man/man9/uvm.9
index 40bd60f..12682bf 100644
--- a/man/man9/uvm.9
+++ b/man/man9/uvm.9
@@ -466,6 +466,8 @@ The flags can be
 #define UFP_NOALLOC     0x02    /* don't allocate new pages */
 #define UFP_NOCACHE     0x04    /* don't return pages which already exist */
 #define UFP_NORDONLY    0x08    /* don't return PG_READONLY pages */
+#define UFP_DIRTYONLY   0x10
+#define UFP_BACKWARD    0x20
 .Ed
 .Pp
 .Dv UFP_ALL
@@ -478,6 +480,10 @@ causes any pages which do not already exist to be skipped.
 causes any pages which do already exist to be skipped.
 .Dv UFP_NORDONLY
 causes any pages which are marked PG_READONLY to be skipped.
+.Dv UFP_DIRTYONLY
+causes any clean pags to be skipped
+.Dv UFP_BACKWARD
+causes to scan pages in the backward order
 .Pp
 .Fn uvm_vnp_setsize
 sets the size of vnode



Home | Main Index | Thread Index | Old Index