am f2f74ca6: Merge "Remove references to obsolete pmem functionality."

* commit 'f2f74ca65f34ae0cae6f0cca40f1c18aa771739d':
  Remove references to obsolete pmem functionality.
This commit is contained in:
Elliott Hughes 2013-11-21 18:43:51 -08:00 committed by Android Git Automerger
commit 0d103b596d

View File

@ -31,11 +31,6 @@
#include <binder/MemoryHeapBase.h> #include <binder/MemoryHeapBase.h>
#ifdef HAVE_ANDROID_OS
#include <linux/android_pmem.h>
#endif
namespace android { namespace android {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@ -108,18 +103,9 @@ status_t MemoryHeapBase::mapfd(int fd, size_t size, uint32_t offset)
{ {
if (size == 0) { if (size == 0) {
// try to figure out the size automatically // try to figure out the size automatically
#ifdef HAVE_ANDROID_OS struct stat sb;
// first try the PMEM ioctl if (fstat(fd, &sb) == 0)
pmem_region reg; size = sb.st_size;
int err = ioctl(fd, PMEM_GET_TOTAL_SIZE, &reg);
if (err == 0)
size = reg.len;
#endif
if (size == 0) { // try fstat
struct stat sb;
if (fstat(fd, &sb) == 0)
size = sb.st_size;
}
// if it didn't work, let mmap() fail. // if it didn't work, let mmap() fail.
} }