Just a bit of cleanup, remove trailing whitespace mostly. No functional changes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24995 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2008-04-17 10:02:49 +00:00
parent 0eaadd30b2
commit b8c45ca140
13 changed files with 266 additions and 197 deletions
@@ -83,6 +83,7 @@ dosfs_open_attrdir(fs_volume *_vol, fs_vnode *_node, void **_cookie)
return 0; return 0;
} }
status_t status_t
dosfs_close_attrdir(fs_volume *_vol, fs_vnode *_node, void *_cookie) dosfs_close_attrdir(fs_volume *_vol, fs_vnode *_node, void *_cookie)
{ {
@@ -291,6 +292,7 @@ dosfs_read_attr(fs_volume *_vol, fs_vnode *_node, void *_cookie, off_t pos,
return 0; return 0;
} }
// suck up application attempts to set mime types; this hides an unsightly // suck up application attempts to set mime types; this hides an unsightly
// error message printed out by zip // error message printed out by zip
status_t status_t
+5 -1
View File
@@ -804,7 +804,9 @@ update_fsinfo(nspace *vol)
} }
} }
static status_t get_fsinfo(nspace *vol, uint32 *free_count, uint32 *last_allocated)
static status_t
get_fsinfo(nspace *vol, uint32 *free_count, uint32 *last_allocated)
{ {
uchar *buffer; uchar *buffer;
int32 result; int32 result;
@@ -880,6 +882,7 @@ dosfs_unmount(fs_volume *_vol)
return result; return result;
} }
// dosfs_read_fs_stat - Fill in fs_info struct for device. // dosfs_read_fs_stat - Fill in fs_info struct for device.
static status_t static status_t
dosfs_read_fs_stat(fs_volume *_vol, struct fs_info * fss) dosfs_read_fs_stat(fs_volume *_vol, struct fs_info * fss)
@@ -939,6 +942,7 @@ dosfs_read_fs_stat(fs_volume *_vol, struct fs_info * fss)
return B_OK; return B_OK;
} }
static status_t static status_t
dosfs_write_fs_stat(fs_volume *_vol, const struct fs_info * fss, uint32 mask) dosfs_write_fs_stat(fs_volume *_vol, const struct fs_info * fss, uint32 mask)
{ {
+34 -12
View File
@@ -21,7 +21,8 @@
#define DPRINTF(a,b) if (debug_fat > (a)) dprintf b #define DPRINTF(a,b) if (debug_fat > (a)) dprintf b
static status_t mirror_fats(nspace *vol, uint32 sector, uint8 *buffer, int32 tid) static status_t
mirror_fats(nspace *vol, uint32 sector, uint8 *buffer, int32 tid)
{ {
uint32 i; uint32 i;
char *buf = buffer; char *buf = buffer;
@@ -44,7 +45,9 @@ static status_t mirror_fats(nspace *vol, uint32 sector, uint8 *buffer, int32 tid
return B_OK; return B_OK;
} }
static int32 _count_free_clusters_fat32(nspace *vol)
static int32
_count_free_clusters_fat32(nspace *vol)
{ {
int32 count = 0; int32 count = 0;
const uint8 *block; const uint8 *block;
@@ -79,7 +82,8 @@ static int32 _count_free_clusters_fat32(nspace *vol)
enum { _IOCTL_COUNT_FREE_, _IOCTL_GET_ENTRY_, _IOCTL_SET_ENTRY_, _IOCTL_ALLOCATE_N_ENTRIES_ }; enum { _IOCTL_COUNT_FREE_, _IOCTL_GET_ENTRY_, _IOCTL_SET_ENTRY_, _IOCTL_ALLOCATE_N_ENTRIES_ };
static int32 _fat_ioctl_(nspace *vol, uint32 action, uint32 cluster, int32 N, int32 _tid) static int32
_fat_ioctl_(nspace *vol, uint32 action, uint32 cluster, int32 N, int32 _tid)
{ {
int32 result = 0; int32 result = 0;
uint32 n = 0, first = 0, last = 0; uint32 n = 0, first = 0, last = 0;
@@ -323,12 +327,16 @@ bi:
return result; return result;
} }
int32 count_free_clusters(nspace *vol)
int32
count_free_clusters(nspace *vol)
{ {
return _fat_ioctl_(vol, _IOCTL_COUNT_FREE_, 0, 0, -1); return _fat_ioctl_(vol, _IOCTL_COUNT_FREE_, 0, 0, -1);
} }
static int32 get_fat_entry(nspace *vol, uint32 cluster)
static int32
get_fat_entry(nspace *vol, uint32 cluster)
{ {
int32 value = _fat_ioctl_(vol, _IOCTL_GET_ENTRY_, cluster, 0, -1); int32 value = _fat_ioctl_(vol, _IOCTL_GET_ENTRY_, cluster, 0, -1);
@@ -348,13 +356,17 @@ static int32 get_fat_entry(nspace *vol, uint32 cluster)
return BAD_FAT_ENTRY; return BAD_FAT_ENTRY;
} }
static status_t set_fat_entry(nspace *vol, uint32 cluster, int32 value)
static status_t
set_fat_entry(nspace *vol, uint32 cluster, int32 value)
{ {
return _fat_ioctl_(vol, _IOCTL_SET_ENTRY_, cluster, value, -1); return _fat_ioctl_(vol, _IOCTL_SET_ENTRY_, cluster, value, -1);
} }
// traverse n fat entries // traverse n fat entries
int32 get_nth_fat_entry(nspace *vol, int32 cluster, uint32 n) int32
get_nth_fat_entry(nspace *vol, int32 cluster, uint32 n)
{ {
if (check_nspace_magic(vol, "get_nth_fat_entry")) return EINVAL; if (check_nspace_magic(vol, "get_nth_fat_entry")) return EINVAL;
@@ -370,10 +382,12 @@ int32 get_nth_fat_entry(nspace *vol, int32 cluster, uint32 n)
return cluster; return cluster;
} }
// count number of clusters in fat chain starting at given cluster // count number of clusters in fat chain starting at given cluster
// should only be used for calculating directory sizes because it doesn't // should only be used for calculating directory sizes because it doesn't
// return proper error codes // return proper error codes
uint32 count_clusters(nspace *vol, int32 cluster) uint32
count_clusters(nspace *vol, int32 cluster)
{ {
int32 count = 0; int32 count = 0;
@@ -408,7 +422,9 @@ uint32 count_clusters(nspace *vol, int32 cluster)
return 0; return 0;
} }
status_t clear_fat_chain(nspace *vol, uint32 cluster)
status_t
clear_fat_chain(nspace *vol, uint32 cluster)
{ {
int32 c; int32 c;
status_t result; status_t result;
@@ -442,7 +458,9 @@ status_t clear_fat_chain(nspace *vol, uint32 cluster)
return 0; return 0;
} }
status_t allocate_n_fat_entries(nspace *vol, int32 n, int32 *start)
status_t
allocate_n_fat_entries(nspace *vol, int32 n, int32 *start)
{ {
int32 c; int32 c;
@@ -463,7 +481,9 @@ status_t allocate_n_fat_entries(nspace *vol, int32 n, int32 *start)
return 0; return 0;
} }
status_t set_fat_chain_length(nspace *vol, vnode *node, uint32 clusters)
status_t
set_fat_chain_length(nspace *vol, vnode *node, uint32 clusters)
{ {
status_t result; status_t result;
int32 i, c, n; int32 i, c, n;
@@ -570,7 +590,9 @@ status_t set_fat_chain_length(nspace *vol, vnode *node, uint32 clusters)
return clear_fat_chain(vol, n); return clear_fat_chain(vol, n);
} }
void dump_fat_chain(nspace *vol, uint32 cluster)
void
dump_fat_chain(nspace *vol, uint32 cluster)
{ {
dprintf("fat chain: %lx", cluster); dprintf("fat chain: %lx", cluster);
while (IS_DATA_CLUSTER(cluster)) { while (IS_DATA_CLUSTER(cluster)) {
@@ -1363,6 +1363,7 @@ dosfs_remove_vnode(fs_volume *_vol, fs_vnode *_node, bool reenter)
return B_OK; return B_OK;
} }
// get rid of node or directory // get rid of node or directory
static status_t static status_t
do_unlink(fs_volume *_vol, fs_vnode *_dir, const char *name, bool is_file) do_unlink(fs_volume *_vol, fs_vnode *_dir, const char *name, bool is_file)
@@ -1475,6 +1476,7 @@ bi:
return result; return result;
} }
status_t status_t
dosfs_unlink(fs_volume *vol, fs_vnode *dir, const char *name) dosfs_unlink(fs_volume *vol, fs_vnode *dir, const char *name)
{ {
+22 -8
View File
@@ -19,7 +19,8 @@ static int32 tzoffset = -1; /* in minutes */
#ifdef DEBUG #ifdef DEBUG
int _assert_(char *a, int b, char *c) int
_assert_(char *a, int b, char *c)
{ {
dprintf("tripped assertion in %s/%d (%s)\n", a, b, c); dprintf("tripped assertion in %s/%d (%s)\n", a, b, c);
kernel_debugger("tripped assertion"); kernel_debugger("tripped assertion");
@@ -28,12 +29,15 @@ int _assert_(char *a, int b, char *c)
#endif #endif
static void print_byte(uint8 c) static void
print_byte(uint8 c)
{ {
dprintf("%c", ((c >= ' ') && (c <= '~')) ? c : '.'); dprintf("%c", ((c >= ' ') && (c <= '~')) ? c : '.');
} }
void dump_bytes(uint8 *buffer, uint32 count)
void
dump_bytes(uint8 *buffer, uint32 count)
{ {
uint32 i, j, k; uint32 i, j, k;
for (i=0;i<0x10;i++) for (i=0;i<0x10;i++)
@@ -52,12 +56,16 @@ void dump_bytes(uint8 *buffer, uint32 count)
} }
} }
void dump_directory(uint8 *buffer)
void
dump_directory(uint8 *buffer)
{ {
dump_bytes(buffer, 32); dump_bytes(buffer, 32);
} }
static void get_tzoffset()
static void
get_tzoffset()
{ {
rtc_info info; rtc_info info;
@@ -71,6 +79,7 @@ static void get_tzoffset()
} }
} }
// If divisible by 4, but not divisible by 100, but divisible by 400, it's a leap year // If divisible by 4, but not divisible by 100, but divisible by 400, it's a leap year
// 1996 is leap, 1900 is not, 2000 is, 2100 is not // 1996 is leap, 1900 is not, 2000 is, 2100 is not
#define IS_LEAP_YEAR(y) ((((y) % 4) == 0) && (((y) % 100) || ((((y)) % 400) == 0))) #define IS_LEAP_YEAR(y) ((((y) % 4) == 0) && (((y) % 100) || ((((y)) % 400) == 0)))
@@ -88,7 +97,8 @@ static int leaps(int yr, int mon)
static int daze[] = { 0,0,31,59,90,120,151,181,212,243,273,304,334,0,0,0 }; static int daze[] = { 0,0,31,59,90,120,151,181,212,243,273,304,334,0,0,0 };
time_t dos2time_t(uint32 t) time_t
dos2time_t(uint32 t)
{ {
time_t days; time_t days;
@@ -103,7 +113,9 @@ time_t dos2time_t(uint32 t)
return (((days * 24) + ((t>>11)&31)) * 60 + ((t>>5)&63) + tzoffset) * 60 + 2*(t&31); return (((days * 24) + ((t>>11)&31)) * 60 + ((t>>5)&63) + tzoffset) * 60 + 2*(t&31);
} }
uint32 time_t2dos(time_t s)
uint32
time_t2dos(time_t s)
{ {
uint32 t, d, y; uint32 t, d, y;
int days; int days;
@@ -141,7 +153,9 @@ bi:
return t + (d << 16) + (y << 25); return t + (d << 16) + (y << 25);
} }
uint8 hash_msdos_name(const char *name)
uint8
hash_msdos_name(const char *name)
{ {
const uint8 *p = (const uint8 *)name; const uint8 *p = (const uint8 *)name;
int i; int i;
+38 -13
View File
@@ -118,7 +118,9 @@ status_t init_vcache(nspace *vol)
return 0; return 0;
} }
status_t uninit_vcache(nspace *vol)
status_t
uninit_vcache(nspace *vol)
{ {
uint32 i, count = 0; uint32 i, count = 0;
struct vcache_entry *c, *n; struct vcache_entry *c, *n;
@@ -147,7 +149,9 @@ status_t uninit_vcache(nspace *vol)
return 0; return 0;
} }
ino_t generate_unique_vnid(nspace *vol)
ino_t
generate_unique_vnid(nspace *vol)
{ {
DPRINTF(0, ("generate_unique_vnid\n")); DPRINTF(0, ("generate_unique_vnid\n"));
/* only one thread per volume will be in here at any given time anyway /* only one thread per volume will be in here at any given time anyway
@@ -155,7 +159,9 @@ ino_t generate_unique_vnid(nspace *vol)
return vol->vcache.cur_vnid++; return vol->vcache.cur_vnid++;
} }
static status_t _add_to_vcache_(nspace *vol, ino_t vnid, ino_t loc)
static status_t
_add_to_vcache_(nspace *vol, ino_t vnid, ino_t loc)
{ {
int hash1 = hash(vnid), hash2 = hash(loc); int hash1 = hash(vnid), hash2 = hash(loc);
struct vcache_entry *e, *c, *p; struct vcache_entry *e, *c, *p;
@@ -205,7 +211,9 @@ static status_t _add_to_vcache_(nspace *vol, ino_t vnid, ino_t loc)
return B_OK; return B_OK;
} }
static status_t _remove_from_vcache_(nspace *vol, ino_t vnid)
static status_t
_remove_from_vcache_(nspace *vol, ino_t vnid)
{ {
int hash1 = hash(vnid), hash2; int hash1 = hash(vnid), hash2;
struct vcache_entry *c, *p, *e; struct vcache_entry *c, *p, *e;
@@ -252,7 +260,9 @@ static status_t _remove_from_vcache_(nspace *vol, ino_t vnid)
return 0; return 0;
} }
static struct vcache_entry *_find_vnid_in_vcache_(nspace *vol, ino_t vnid)
static struct vcache_entry *
_find_vnid_in_vcache_(nspace *vol, ino_t vnid)
{ {
int hash1 = hash(vnid); int hash1 = hash(vnid);
struct vcache_entry *c; struct vcache_entry *c;
@@ -268,7 +278,9 @@ static struct vcache_entry *_find_vnid_in_vcache_(nspace *vol, ino_t vnid)
return c; return c;
} }
static struct vcache_entry *_find_loc_in_vcache_(nspace *vol, ino_t loc)
static struct vcache_entry *
_find_loc_in_vcache_(nspace *vol, ino_t loc)
{ {
int hash2 = hash(loc); int hash2 = hash(loc);
struct vcache_entry *c; struct vcache_entry *c;
@@ -284,7 +296,9 @@ static struct vcache_entry *_find_loc_in_vcache_(nspace *vol, ino_t loc)
return c; return c;
} }
status_t add_to_vcache(nspace *vol, ino_t vnid, ino_t loc)
status_t
add_to_vcache(nspace *vol, ino_t vnid, ino_t loc)
{ {
status_t result; status_t result;
@@ -296,8 +310,10 @@ status_t add_to_vcache(nspace *vol, ino_t vnid, ino_t loc)
return result; return result;
} }
/* XXX: do this in a smarter fashion */ /* XXX: do this in a smarter fashion */
static status_t _update_loc_in_vcache_(nspace *vol, ino_t vnid, ino_t loc) static status_t
_update_loc_in_vcache_(nspace *vol, ino_t vnid, ino_t loc)
{ {
status_t result; status_t result;
@@ -308,7 +324,9 @@ static status_t _update_loc_in_vcache_(nspace *vol, ino_t vnid, ino_t loc)
return result; return result;
} }
status_t remove_from_vcache(nspace *vol, ino_t vnid)
status_t
remove_from_vcache(nspace *vol, ino_t vnid)
{ {
status_t result; status_t result;
@@ -320,7 +338,9 @@ status_t remove_from_vcache(nspace *vol, ino_t vnid)
return result; return result;
} }
status_t vcache_vnid_to_loc(nspace *vol, ino_t vnid, ino_t *loc)
status_t
vcache_vnid_to_loc(nspace *vol, ino_t vnid, ino_t *loc)
{ {
struct vcache_entry *e; struct vcache_entry *e;
@@ -335,7 +355,9 @@ status_t vcache_vnid_to_loc(nspace *vol, ino_t vnid, ino_t *loc)
return (e) ? B_OK : ENOENT; return (e) ? B_OK : ENOENT;
} }
status_t vcache_loc_to_vnid(nspace *vol, ino_t loc, ino_t *vnid)
status_t
vcache_loc_to_vnid(nspace *vol, ino_t loc, ino_t *vnid)
{ {
struct vcache_entry *e; struct vcache_entry *e;
@@ -350,7 +372,9 @@ status_t vcache_loc_to_vnid(nspace *vol, ino_t loc, ino_t *vnid)
return (e) ? B_OK : ENOENT; return (e) ? B_OK : ENOENT;
} }
status_t vcache_set_entry(nspace *vol, ino_t vnid, ino_t loc)
status_t
vcache_set_entry(nspace *vol, ino_t vnid, ino_t loc)
{ {
struct vcache_entry *e; struct vcache_entry *e;
status_t result = B_OK; status_t result = B_OK;
@@ -385,7 +409,8 @@ status_t vcache_set_entry(nspace *vol, ino_t vnid, ino_t loc)
#if DEBUG #if DEBUG
int debug_dfvnid(int argc, char **argv) int
debug_dfvnid(int argc, char **argv)
{ {
int i; int i;
nspace *vol; nspace *vol;