*** empty log message ***

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11568 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2005-03-03 23:36:57 +00:00
parent efaa1f0e73
commit 105d7373e9
7 changed files with 30 additions and 25 deletions

View File

@ -1,11 +1,9 @@
#define _FS_INTERFACE_H #include "compat.h"
// don't include that file
#include <stdio.h> #include <stdio.h>
#include <StorageDefs.h> #include <StorageDefs.h>
#include "compat.h"
#include "fsproto.h" #include "fsproto.h"
#include "kprotos.h" #include "kprotos.h"
#include "bfs_control.h" #include "bfs_control.h"
@ -17,7 +15,7 @@ static int
do_chkbfs(int argc, char **argv) do_chkbfs(int argc, char **argv)
{ {
struct check_control result; struct check_control result;
off_t files = 0, directories = 0, indices = 0, attributeDirectories = 0, attributes = 0; fs_off_t files = 0, directories = 0, indices = 0, attributeDirectories = 0, attributes = 0;
int counter = 0; int counter = 0;
int fd = sys_open(1, -1, "/myfs/.", O_RDONLY, S_IFREG, 0); int fd = sys_open(1, -1, "/myfs/.", O_RDONLY, S_IFREG, 0);
@ -40,7 +38,7 @@ do_chkbfs(int argc, char **argv)
} }
// check all files and report errors // check all files and report errors
while (sys_ioctl(1, fd, BFS_IOCTL_CHECK_NEXT_NODE, &result, sizeof(result)) == B_OK) { while (sys_ioctl(1, fd, BFS_IOCTL_CHECK_NEXT_NODE, &result, sizeof(result)) == FS_OK) {
if (++counter % 50 == 0) if (++counter % 50 == 0)
printf(" %7d nodes processed\x1b[1A\n", counter); printf(" %7d nodes processed\x1b[1A\n", counter);
@ -60,18 +58,18 @@ do_chkbfs(int argc, char **argv)
printf(", names don't match"); printf(", names don't match");
putchar('\n'); putchar('\n');
} }
if ((result.mode & (S_INDEX_DIR | 0777)) == S_INDEX_DIR) if ((result.mode & (MY_S_INDEX_DIR | 0777)) == MY_S_INDEX_DIR)
indices++; indices++;
else if (result.mode & S_ATTR_DIR) else if (result.mode & MY_S_ATTR_DIR)
attributeDirectories++; attributeDirectories++;
else if (result.mode & S_ATTR) else if (result.mode & MY_S_ATTR)
attributes++; attributes++;
else if (result.mode & S_IFDIR) else if (result.mode & MY_S_IFDIR)
directories++; directories++;
else else
files++; files++;
} }
if (result.status != B_ENTRY_NOT_FOUND) if (result.status != FS_ENTRY_NOT_FOUND)
printf("chkbfs: error occured during scan: %s\n", strerror(result.status)); printf("chkbfs: error occured during scan: %s\n", strerror(result.status));
// stop checking // stop checking

View File

@ -242,8 +242,8 @@ class BPlusTree {
void RemoveIterator(TreeIterator *iterator); void RemoveIterator(TreeIterator *iterator);
private: private:
friend TreeIterator; friend struct TreeIterator;
friend CachedNode; friend class CachedNode;
Inode *fStream; Inode *fStream;
bplustree_header *fHeader; bplustree_header *fHeader;
@ -292,8 +292,8 @@ class TreeIterator {
bool fIsFragment; bool fIsFragment;
private: private:
friend Chain<TreeIterator>; friend class Chain<TreeIterator>;
friend BPlusTree; friend class BPlusTree;
void Update(off_t offset, off_t nextOffset, uint16 keyIndex, uint16 splitAt, int8 change); void Update(off_t offset, off_t nextOffset, uint16 keyIndex, uint16 splitAt, int8 change);
void Stop(); void Stop();

View File

@ -9,7 +9,7 @@
#include <KernelExport.h> #include <KernelExport.h>
#ifdef USER #ifdef USER
# include "myfs.h" //# include "myfs.h"
# include <stdio.h> # include <stdio.h>
#endif #endif
@ -186,8 +186,8 @@ class Inode : public CachedBlock {
// no implementation // no implementation
friend void dump_inode(Inode &inode); friend void dump_inode(Inode &inode);
friend AttributeIterator; friend class AttributeIterator;
friend InodeAllocator; friend class InodeAllocator;
void Initialize(); void Initialize();
@ -283,8 +283,8 @@ class AttributeIterator {
void *fBuffer; void *fBuffer;
private: private:
friend Chain<AttributeIterator>; friend class Chain<AttributeIterator>;
friend Inode; friend class Inode;
void Update(uint16 index, int8 change); void Update(uint16 index, int8 change);
AttributeIterator *fNext; AttributeIterator *fNext;

View File

@ -10,7 +10,7 @@
#include <KernelExport.h> #include <KernelExport.h>
#ifdef USER #ifdef USER
# include "myfs.h" //# include "myfs.h"
# include <stdio.h> # include <stdio.h>
#endif #endif
@ -68,7 +68,7 @@ class Journal {
inline uint32 FreeLogBlocks() const; inline uint32 FreeLogBlocks() const;
private: private:
friend log_entry; friend struct log_entry;
static void blockNotify(off_t blockNumber, size_t numBlocks, void *arg); static void blockNotify(off_t blockNumber, size_t numBlocks, void *arg);
status_t TransactionDone(bool success); status_t TransactionDone(bool success);

View File

@ -70,7 +70,7 @@ class Query {
int32 fToken; int32 fToken;
private: private:
friend Chain<Query>; friend class Chain<Query>;
Query *fNext; Query *fNext;
}; };

View File

@ -21,6 +21,13 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
// fs_shell support for build platforms whose struct stat is not compatible with ours
#ifdef build_platform_fstat
extern "C" int build_platform_fstat(int fd, struct stat *st);
#else
# define build_platform_fstat fstat
#endif
static const int32 kDesiredAllocationGroups = 56; static const int32 kDesiredAllocationGroups = 56;
// This is the number of allocation groups that will be tried // This is the number of allocation groups that will be tried
@ -122,7 +129,7 @@ DeviceOpener::GetSize(off_t *_size, uint32 *_blockSize)
if (ioctl(fDevice, B_GET_GEOMETRY, &geometry) < 0) { if (ioctl(fDevice, B_GET_GEOMETRY, &geometry) < 0) {
// maybe it's just a file // maybe it's just a file
struct stat stat; struct stat stat;
if (fstat(fDevice, &stat) < 0) if (build_platform_fstat(fDevice, &stat) < 0)
return B_ERROR; return B_ERROR;
if (_size) if (_size)
@ -288,7 +295,7 @@ Volume::Mount(const char *deviceName, uint32 flags)
// check if it's a regular file, and if so, disable the cache for the // check if it's a regular file, and if so, disable the cache for the
// underlaying file system // underlaying file system
struct stat stat; struct stat stat;
if (fstat(fDevice, &stat) < 0) if (build_platform_fstat(fDevice, &stat) < 0)
RETURN_ERROR(B_ERROR); RETURN_ERROR(B_ERROR);
#ifndef NO_FILE_UNCACHED_IO #ifndef NO_FILE_UNCACHED_IO

View File

@ -10,7 +10,7 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h> #include <unistd.h>
#include <iovec.h> //#include <iovec.h>
#include <OS.h> #include <OS.h>
#include <NodeMonitor.h> #include <NodeMonitor.h>