mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix missing static keyword in extfs.
This commit is contained in:
parent
b5b2d159c6
commit
21c82e4467
6 changed files with 96 additions and 95 deletions
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2014, 2015.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
|
@ -25,7 +25,7 @@
|
|||
|
||||
class Block;
|
||||
|
||||
const size_t DEVICE_HASH_LENGTH = 1 << 16;
|
||||
static const size_t DEVICE_HASH_LENGTH = 1 << 16;
|
||||
|
||||
class Device
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2015.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
|
@ -23,62 +23,62 @@
|
|||
#ifndef EXT_CONSTANTS_H
|
||||
#define EXT_CONSTANTS_H
|
||||
|
||||
const uint16_t EXT2_SUPER_MAGIC = 0xEF53;
|
||||
const uint16_t EXT2_VALID_FS = 1;
|
||||
const uint16_t EXT2_ERROR_FS = 2;
|
||||
const uint16_t EXT2_ERRORS_CONTINUE = 1;
|
||||
const uint16_t EXT2_ERRORS_RO = 2;
|
||||
const uint16_t EXT2_ERRORS_PANIC = 3;
|
||||
const uint32_t EXT2_OS_LINUX = 0;
|
||||
const uint32_t EXT2_OS_HURD = 1;
|
||||
const uint32_t EXT2_OS_MASIX = 2;
|
||||
const uint32_t EXT2_OS_FREEBSD = 3;
|
||||
const uint32_t EXT2_OS_LITES = 4;
|
||||
const uint32_t EXT2_GOOD_OLD_REV = 0;
|
||||
const uint32_t EXT2_DYNAMIC_REV = 1;
|
||||
const uint16_t EXT2_DEF_RESUID = 0;
|
||||
const uint16_t EXT2_DEF_RESGID = 0;
|
||||
const uint16_t EXT2_GOOD_OLD_FIRST_INO = 11;
|
||||
const uint16_t EXT2_GOOD_OLD_INODE_SIZE = 128;
|
||||
const uint32_t EXT2_FEATURE_COMPAT_DIR_PREALLOC = 1U << 0U;
|
||||
const uint32_t EXT2_FEATURE_COMPAT_IMAGIC_INODES = 1U << 1U;
|
||||
const uint32_t EXT3_FEATURE_COMPAT_HAS_JOURNAL = 1U << 2U;
|
||||
const uint32_t EXT2_FEATURE_COMPAT_EXT_ATTR = 1U << 3U;
|
||||
const uint32_t EXT2_FEATURE_COMPAT_RESIZE_INO = 1U << 4U;
|
||||
const uint32_t EXT2_FEATURE_COMPAT_DIR_INDEX = 1U << 5U;
|
||||
const uint32_t EXT2_FEATURE_INCOMPAT_COMPRESSION = 1U << 0U;
|
||||
const uint32_t EXT2_FEATURE_INCOMPAT_FILETYPE = 1U << 1U;
|
||||
const uint32_t EXT2_FEATURE_INCOMPAT_RECOVER = 1U << 2U;
|
||||
const uint32_t EXT2_FEATURE_INCOMPAT_JOURNAL_DEV = 1U << 3U;
|
||||
const uint32_t EXT2_FEATURE_INCOMPAT_META_BG = 1U << 4U;
|
||||
const uint32_t EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER = 1U << 0U;
|
||||
const uint32_t EXT2_FEATURE_RO_COMPAT_LARGE_FILE = 1U << 1U;
|
||||
const uint32_t EXT2_FEATURE_RO_COMPAT_BTREE_DIR = 1U << 2U;
|
||||
const uint32_t EXT2_LZV1_ALG = 1U << 0U;
|
||||
const uint32_t EXT2_LZRW3A_ALG = 1U << 1U;
|
||||
const uint32_t EXT2_GZIP_ALG = 1U << 2U;
|
||||
const uint32_t EXT2_BZIP2_ALG = 1U << 3U;
|
||||
const uint32_t EXT2_LZO_ALG = 1U << 4U;
|
||||
const uint16_t EXT2_S_IFMT = 0xF000;
|
||||
const uint16_t EXT2_S_IFSOCK = 0xC000;
|
||||
const uint16_t EXT2_S_IFLNK = 0xA000;
|
||||
const uint16_t EXT2_S_IFREG = 0x8000;
|
||||
const uint16_t EXT2_S_IFBLK = 0x6000;
|
||||
const uint16_t EXT2_S_IFDIR = 0x4000;
|
||||
const uint16_t EXT2_S_IFCHR = 0x2000;
|
||||
const uint16_t EXT2_S_IFIFO = 0x1000;
|
||||
const uint16_t EXT2_S_ISUID = 0x0800;
|
||||
const uint16_t EXT2_S_ISGID = 0x0400;
|
||||
const uint16_t EXT2_S_ISVTX = 0x0200;
|
||||
const uint16_t EXT2_S_IRUSR = 0x0100;
|
||||
const uint16_t EXT2_S_IWUSR = 0x0080;
|
||||
const uint16_t EXT2_S_IXUSR = 0x0040;
|
||||
const uint16_t EXT2_S_IRGRP = 0x0020;
|
||||
const uint16_t EXT2_S_IWGRP = 0x0010;
|
||||
const uint16_t EXT2_S_IXGRP = 0x0008;
|
||||
const uint16_t EXT2_S_IROTH = 0x0004;
|
||||
const uint16_t EXT2_S_IWOTH = 0x0002;
|
||||
const uint16_t EXT2_S_IXOTH = 0x0001;
|
||||
static const uint16_t EXT2_SUPER_MAGIC = 0xEF53;
|
||||
static const uint16_t EXT2_VALID_FS = 1;
|
||||
static const uint16_t EXT2_ERROR_FS = 2;
|
||||
static const uint16_t EXT2_ERRORS_CONTINUE = 1;
|
||||
static const uint16_t EXT2_ERRORS_RO = 2;
|
||||
static const uint16_t EXT2_ERRORS_PANIC = 3;
|
||||
static const uint32_t EXT2_OS_LINUX = 0;
|
||||
static const uint32_t EXT2_OS_HURD = 1;
|
||||
static const uint32_t EXT2_OS_MASIX = 2;
|
||||
static const uint32_t EXT2_OS_FREEBSD = 3;
|
||||
static const uint32_t EXT2_OS_LITES = 4;
|
||||
static const uint32_t EXT2_GOOD_OLD_REV = 0;
|
||||
static const uint32_t EXT2_DYNAMIC_REV = 1;
|
||||
static const uint16_t EXT2_DEF_RESUID = 0;
|
||||
static const uint16_t EXT2_DEF_RESGID = 0;
|
||||
static const uint16_t EXT2_GOOD_OLD_FIRST_INO = 11;
|
||||
static const uint16_t EXT2_GOOD_OLD_INODE_SIZE = 128;
|
||||
static const uint32_t EXT2_FEATURE_COMPAT_DIR_PREALLOC = 1U << 0U;
|
||||
static const uint32_t EXT2_FEATURE_COMPAT_IMAGIC_INODES = 1U << 1U;
|
||||
static const uint32_t EXT3_FEATURE_COMPAT_HAS_JOURNAL = 1U << 2U;
|
||||
static const uint32_t EXT2_FEATURE_COMPAT_EXT_ATTR = 1U << 3U;
|
||||
static const uint32_t EXT2_FEATURE_COMPAT_RESIZE_INO = 1U << 4U;
|
||||
static const uint32_t EXT2_FEATURE_COMPAT_DIR_INDEX = 1U << 5U;
|
||||
static const uint32_t EXT2_FEATURE_INCOMPAT_COMPRESSION = 1U << 0U;
|
||||
static const uint32_t EXT2_FEATURE_INCOMPAT_FILETYPE = 1U << 1U;
|
||||
static const uint32_t EXT2_FEATURE_INCOMPAT_RECOVER = 1U << 2U;
|
||||
static const uint32_t EXT2_FEATURE_INCOMPAT_JOURNAL_DEV = 1U << 3U;
|
||||
static const uint32_t EXT2_FEATURE_INCOMPAT_META_BG = 1U << 4U;
|
||||
static const uint32_t EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER = 1U << 0U;
|
||||
static const uint32_t EXT2_FEATURE_RO_COMPAT_LARGE_FILE = 1U << 1U;
|
||||
static const uint32_t EXT2_FEATURE_RO_COMPAT_BTREE_DIR = 1U << 2U;
|
||||
static const uint32_t EXT2_LZV1_ALG = 1U << 0U;
|
||||
static const uint32_t EXT2_LZRW3A_ALG = 1U << 1U;
|
||||
static const uint32_t EXT2_GZIP_ALG = 1U << 2U;
|
||||
static const uint32_t EXT2_BZIP2_ALG = 1U << 3U;
|
||||
static const uint32_t EXT2_LZO_ALG = 1U << 4U;
|
||||
static const uint16_t EXT2_S_IFMT = 0xF000;
|
||||
static const uint16_t EXT2_S_IFSOCK = 0xC000;
|
||||
static const uint16_t EXT2_S_IFLNK = 0xA000;
|
||||
static const uint16_t EXT2_S_IFREG = 0x8000;
|
||||
static const uint16_t EXT2_S_IFBLK = 0x6000;
|
||||
static const uint16_t EXT2_S_IFDIR = 0x4000;
|
||||
static const uint16_t EXT2_S_IFCHR = 0x2000;
|
||||
static const uint16_t EXT2_S_IFIFO = 0x1000;
|
||||
static const uint16_t EXT2_S_ISUID = 0x0800;
|
||||
static const uint16_t EXT2_S_ISGID = 0x0400;
|
||||
static const uint16_t EXT2_S_ISVTX = 0x0200;
|
||||
static const uint16_t EXT2_S_IRUSR = 0x0100;
|
||||
static const uint16_t EXT2_S_IWUSR = 0x0080;
|
||||
static const uint16_t EXT2_S_IXUSR = 0x0040;
|
||||
static const uint16_t EXT2_S_IRGRP = 0x0020;
|
||||
static const uint16_t EXT2_S_IWGRP = 0x0010;
|
||||
static const uint16_t EXT2_S_IXGRP = 0x0008;
|
||||
static const uint16_t EXT2_S_IROTH = 0x0004;
|
||||
static const uint16_t EXT2_S_IWOTH = 0x0002;
|
||||
static const uint16_t EXT2_S_IXOTH = 0x0001;
|
||||
#define EXT2_S_ISSOCK(mode) (((mode) & EXT2_S_IFMT) == EXT2_S_IFSOCK)
|
||||
#define EXT2_S_ISLNK(mode) (((mode) & EXT2_S_IFMT) == EXT2_S_IFLNK)
|
||||
#define EXT2_S_ISREG(mode) (((mode) & EXT2_S_IFMT) == EXT2_S_IFREG)
|
||||
|
@ -86,32 +86,32 @@ const uint16_t EXT2_S_IXOTH = 0x0001;
|
|||
#define EXT2_S_ISDIR(mode) (((mode) & EXT2_S_IFMT) == EXT2_S_IFDIR)
|
||||
#define EXT2_S_ISCHR(mode) (((mode) & EXT2_S_IFMT) == EXT2_S_IFCHR)
|
||||
#define EXT2_S_ISFIFO(mode) (((mode) & EXT2_S_IFMT) == EXT2_S_IFIFO)
|
||||
const uint32_t EXT2_SECRM_FL = 0x00000001U;
|
||||
const uint32_t EXT2_UNRM_FL = 0x00000002U;
|
||||
const uint32_t EXT2_COMPR_FL = 0x00000004U;
|
||||
const uint32_t EXT2_SYNC_FL = 0x00000008U;
|
||||
const uint32_t EXT2_IMMUTABLE_FL = 0x00000010U;
|
||||
const uint32_t EXT2_APPEND_FL = 0x00000020U;
|
||||
const uint32_t EXT2_NODUMP_FL = 0x00000040U;
|
||||
const uint32_t EXT2_NOATIME_FL = 0x00000080U;
|
||||
const uint32_t EXT2_DIRTY_FL = 0x00000100U;
|
||||
const uint32_t EXT2_COMPRBLK_FL = 0x00000200U;
|
||||
const uint32_t EXT2_NOCOMPR_FL = 0x00000400U;
|
||||
const uint32_t EXT2_ECOMPR_FL = 0x00000800U;
|
||||
const uint32_t EXT2_BTREE_FL = 0x00001000U;
|
||||
const uint32_t EXT2_INDEX_FL = 0x00001000U;
|
||||
const uint32_t EXT2_IMAGIC_FL = 0x00002000U;
|
||||
const uint32_t EXT3_JOURNAL_DATA_FL = 0x00004000U;
|
||||
const uint32_t EXT2_RESERVED_FL = 0x80000000U;
|
||||
const uint32_t EXT2_ROOT_INO = 2;
|
||||
const uint8_t EXT2_FT_UNKNOWN = 0;
|
||||
const uint8_t EXT2_FT_REG_FILE = 1;
|
||||
const uint8_t EXT2_FT_DIR = 2;
|
||||
const uint8_t EXT2_FT_CHRDEV = 3;
|
||||
const uint8_t EXT2_FT_BLKDEV = 4;
|
||||
const uint8_t EXT2_FT_FIFO = 5;
|
||||
const uint8_t EXT2_FT_SOCK = 6;
|
||||
const uint8_t EXT2_FT_SYMLINK = 7;
|
||||
static const uint32_t EXT2_SECRM_FL = 0x00000001U;
|
||||
static const uint32_t EXT2_UNRM_FL = 0x00000002U;
|
||||
static const uint32_t EXT2_COMPR_FL = 0x00000004U;
|
||||
static const uint32_t EXT2_SYNC_FL = 0x00000008U;
|
||||
static const uint32_t EXT2_IMMUTABLE_FL = 0x00000010U;
|
||||
static const uint32_t EXT2_APPEND_FL = 0x00000020U;
|
||||
static const uint32_t EXT2_NODUMP_FL = 0x00000040U;
|
||||
static const uint32_t EXT2_NOATIME_FL = 0x00000080U;
|
||||
static const uint32_t EXT2_DIRTY_FL = 0x00000100U;
|
||||
static const uint32_t EXT2_COMPRBLK_FL = 0x00000200U;
|
||||
static const uint32_t EXT2_NOCOMPR_FL = 0x00000400U;
|
||||
static const uint32_t EXT2_ECOMPR_FL = 0x00000800U;
|
||||
static const uint32_t EXT2_BTREE_FL = 0x00001000U;
|
||||
static const uint32_t EXT2_INDEX_FL = 0x00001000U;
|
||||
static const uint32_t EXT2_IMAGIC_FL = 0x00002000U;
|
||||
static const uint32_t EXT3_JOURNAL_DATA_FL = 0x00004000U;
|
||||
static const uint32_t EXT2_RESERVED_FL = 0x80000000U;
|
||||
static const uint32_t EXT2_ROOT_INO = 2;
|
||||
static const uint8_t EXT2_FT_UNKNOWN = 0;
|
||||
static const uint8_t EXT2_FT_REG_FILE = 1;
|
||||
static const uint8_t EXT2_FT_DIR = 2;
|
||||
static const uint8_t EXT2_FT_CHRDEV = 3;
|
||||
static const uint8_t EXT2_FT_BLKDEV = 4;
|
||||
static const uint8_t EXT2_FT_FIFO = 5;
|
||||
static const uint8_t EXT2_FT_SOCK = 6;
|
||||
static const uint8_t EXT2_FT_SYMLINK = 7;
|
||||
|
||||
static inline uint8_t EXT2_FT_OF_MODE(mode_t mode)
|
||||
{
|
||||
|
|
|
@ -50,10 +50,10 @@
|
|||
#include "inode.h"
|
||||
#include "ioleast.h"
|
||||
|
||||
const uint32_t EXT2_FEATURE_COMPAT_SUPPORTED = 0;
|
||||
const uint32_t EXT2_FEATURE_INCOMPAT_SUPPORTED = \
|
||||
static const uint32_t EXT2_FEATURE_COMPAT_SUPPORTED = 0;
|
||||
static const uint32_t EXT2_FEATURE_INCOMPAT_SUPPORTED = \
|
||||
EXT2_FEATURE_INCOMPAT_FILETYPE;
|
||||
const uint32_t EXT2_FEATURE_RO_COMPAT_SUPPORTED = \
|
||||
static const uint32_t EXT2_FEATURE_RO_COMPAT_SUPPORTED = \
|
||||
EXT2_FEATURE_RO_COMPAT_LARGE_FILE;
|
||||
|
||||
// TODO: Inode 0 is not valid, but a lot of functions here accept it!
|
||||
|
|
|
@ -27,7 +27,7 @@ class BlockGroup;
|
|||
class Device;
|
||||
class Inode;
|
||||
|
||||
const size_t INODE_HASH_LENGTH = 1 << 16;
|
||||
static const size_t INODE_HASH_LENGTH = 1 << 16;
|
||||
|
||||
class Filesystem
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sortix fsmarshall frontend.
|
||||
|
||||
*******************************************************************************/
|
||||
|
||||
#ifndef FSMARSHALL_H
|
||||
#define FSMARSHALL_H
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/*******************************************************************************
|
||||
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013.
|
||||
Copyright(C) Jonas 'Sortie' Termansen 2013, 2015.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
|
@ -33,18 +33,18 @@ template <class T> T roundup(T a, T b)
|
|||
return a % b ? a + b - a % b : a;
|
||||
}
|
||||
|
||||
inline bool checkbit(const uint8_t* bitmap, size_t bit)
|
||||
static inline bool checkbit(const uint8_t* bitmap, size_t bit)
|
||||
{
|
||||
uint8_t bits = bitmap[bit / 8UL];
|
||||
return bits & (1U << (bit % 8UL));
|
||||
}
|
||||
|
||||
inline void setbit(uint8_t* bitmap, size_t bit)
|
||||
static inline void setbit(uint8_t* bitmap, size_t bit)
|
||||
{
|
||||
bitmap[bit / 8UL] |= 1U << (bit % 8UL);
|
||||
}
|
||||
|
||||
inline void clearbit(uint8_t* bitmap, size_t bit)
|
||||
static inline void clearbit(uint8_t* bitmap, size_t bit)
|
||||
{
|
||||
bitmap[bit / 8UL] &= ~(1U << (bit % 8UL));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue