]> git.neil.brown.name Git - history.git/commit
[PATCH] NOMMU: Improved handling of get_unmapped_area() errors
authorDavid Howells <dhowells@redhat.com>
Tue, 8 Feb 2005 00:05:10 +0000 (16:05 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 8 Feb 2005 00:05:10 +0000 (16:05 -0800)
commitd7c43720790d44853eda25249b4c10c1dd78458e
tree89f53b1db970f5eb4b27272ada5ac561a309f066
parentca323f212407364030c58f64bd94b29213599612
[PATCH] NOMMU: Improved handling of get_unmapped_area() errors

The attached patch does two things:

 (1) We no longer check the return value of file->f_op->get_unmapped_area()
     unless we actually called it. We know addr is zero otherwise because
     we'd've given an error earlier if it wasn't.

 (2) If -ENOSYS was returned by that operation, then we assume we actually
     called a driver (such as the framebuffer driver) that might want to
     invoke the operation in a lower level driver (such as matroxfb) if one
     exists, and that it found that one didn't.

     We translate the -ENOSYS error into -ENODEV - the error we would have
     given if the operation was not supplied in the file ops.

     Doing this permits us an opportunity for arch_get_unmapped_area() or
     something else to be called if we want that to happen, particularly in
     the MMU case.

Signed-Off-By: David Howells <dhowells@redhat.com>
Signed-Off-By: Linus Torvalds <torvalds@osdl.org>
mm/nommu.c