LINUX: Define zero_user_segment
authorAndrew Deason <adeason@sinenomine.net>
Fri, 3 Dec 2010 22:39:57 +0000 (16:39 -0600)
committerDerrick Brashear <shadow@dementia.org>
Sat, 4 Dec 2010 04:19:22 +0000 (20:19 -0800)
When the kernel does not have the zero_user_segments function, we
define it ourselves. Also define the zero_user_segment function, since
we use it, and a kernel lacking zero_user_segments will also lack
zero_user_segment.

Change-Id: I5c786d2af27227793a7a2768d1af76ccd2d6a415
Reviewed-on: http://gerrit.openafs.org/3432
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Matt Benjamin <matt@linuxbox.com>
Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>

src/afs/LINUX/osi_compat.h

index 2ffef0f..511b882 100644 (file)
@@ -233,6 +233,12 @@ zero_user_segments(struct page *pp, unsigned int from1, unsigned int to1,
     flush_dcache_page(pp);
     kunmap_atomic(base, KM_USER0);
 }
+
+static inline void
+zero_user_segment(struct page *pp, unsigned int from1, unsigned int to1)
+{
+    zero_user_segments(pp, from1, to1, 0, 0);
+}
 #endif
 
 #ifndef HAVE_LINUX_KERNEL_SETSOCKOPT