* Reduced the region allocated for the uncompressed data to 16 MB. With

32 MB the kernel's VM initialization code would run into trouble.
  Accessing freshly mapped memory in the generic page mapper would
  result in a page fault. To be investigated.
* Apparently in the boot loader the file systems are responsible for
  resolving symbolic links (instead of the VFS). We do that now.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@21608 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2007-07-15 00:45:10 +00:00
parent 0274089508
commit bf8e5ecab7

View File

@ -34,7 +34,7 @@
static const uint32 kFloppyArchiveOffset = 192 * 1024; // at 192 kB
static const size_t kTarRegionSize = 32 * 1024 * 1024; // 32 MB
static const size_t kTarRegionSize = 16 * 1024 * 1024; // 16 MB
namespace TarFS {
@ -143,6 +143,8 @@ class Symlink : public ::Node, public Entry {
virtual off_t Size() const;
virtual ino_t Inode() const;
const char* LinkPath() const { return fHeader->linkname; }
virtual ::Node *ToNode() { return this; }
private:
@ -367,15 +369,29 @@ TarFS::Directory::LookupEntry(const char *name)
::Node *
TarFS::Directory::Lookup(const char *name, bool /*traverseLinks*/)
TarFS::Directory::Lookup(const char *name, bool traverseLinks)
{
if (TarFS::Entry *entry = LookupEntry(name)) {
entry->ToNode()->Acquire();
// our entries are not supposed to be deleted after use
return entry->ToNode();
TarFS::Entry *entry = LookupEntry(name);
if (!entry)
return NULL;
Node* node = entry->ToNode();
if (traverseLinks) {
if (S_ISLNK(node->Type())) {
Symlink* symlink = static_cast<Symlink*>(node);
int fd = open_from(this, symlink->LinkPath(), O_RDONLY);
if (fd >= 0) {
node = get_node_from(fd);
close(fd);
}
}
}
return NULL;
if (node)
node->Acquire();
return node;
}
@ -536,22 +552,7 @@ TarFS::Symlink::~Symlink()
ssize_t
TarFS::Symlink::ReadAt(void *cookie, off_t pos, void *buffer, size_t bufferSize)
{
TRACE(("tarfs: symlink read at %Ld, %lu bytes, fSize = %Ld\n", pos,
bufferSize, fSize));
if (pos < 0 || !buffer)
return B_BAD_VALUE;
if (pos >= fSize || bufferSize == 0)
return 0;
size_t toRead = fSize - pos;
if (toRead > bufferSize)
toRead = bufferSize;
memcpy(buffer, fHeader->linkname + pos, toRead);
return toRead;
return B_NOT_ALLOWED;
}