Style cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39955 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Lotz
2010-12-26 23:16:04 +00:00
parent 6b81e70656
commit 79dd7e57fa
+15 -6
View File
@@ -37,10 +37,11 @@
#include "lock.h" #include "lock.h"
#include "ntfsdir.h" #include "ntfsdir.h"
//callback function for readdir() //callback function for readdir()
static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name, static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
const int name_len, const int name_type, const s64 pos, const int name_len, const int name_type, const s64 pos, const MFT_REF mref,
const MFT_REF mref, const unsigned dt_type) const unsigned dt_type)
{ {
char *filename = NULL; char *filename = NULL;
dircookie *cookie = (dircookie*)_dirent; dircookie *cookie = (dircookie*)_dirent;
@@ -48,7 +49,8 @@ static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
if (name_type == FILE_NAME_DOS) if (name_type == FILE_NAME_DOS)
return 0; return 0;
if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user || cookie->show_sys_files) { if (MREF(mref) == FILE_root || MREF(mref) >= FILE_first_user
|| cookie->show_sys_files) {
if (cookie->readed == 1) { if (cookie->readed == 1) {
cookie->pos=pos; cookie->pos=pos;
cookie->readed = 0; cookie->readed = 0;
@@ -63,12 +65,15 @@ static int _ntfs_dirent_filler(void *_dirent, const ntfschar *name,
return 0; return 0;
} }
} }
return -1; return -1;
} }
} }
return 0; return 0;
} }
status_t status_t
fs_free_dircookie(fs_volume *_vol, fs_vnode *vnode, void *cookie) fs_free_dircookie(fs_volume *_vol, fs_vnode *vnode, void *cookie)
{ {
@@ -86,6 +91,7 @@ fs_free_dircookie( fs_volume *_vol, fs_vnode *vnode, void *cookie )
return B_NO_ERROR; return B_NO_ERROR;
} }
status_t status_t
fs_opendir(fs_volume *_vol, fs_vnode *_node, void** _cookie) fs_opendir(fs_volume *_vol, fs_vnode *_node, void** _cookie)
{ {
@@ -118,9 +124,9 @@ fs_opendir( fs_volume *_vol, fs_vnode *_node, void** _cookie )
cookie->name[0] = 0; cookie->name[0] = 0;
cookie->show_sys_files = ns->show_sys_files; cookie->show_sys_files = ns->show_sys_files;
*_cookie = (void*)cookie; *_cookie = (void*)cookie;
} } else
else
result = ENOMEM; result = ENOMEM;
exit: exit:
if (ni) if (ni)
ntfs_inode_close(ni); ntfs_inode_close(ni);
@@ -132,6 +138,7 @@ exit:
return result; return result;
} }
status_t status_t
fs_closedir(fs_volume *_vol, fs_vnode *_node, void *cookie) fs_closedir(fs_volume *_vol, fs_vnode *_node, void *cookie)
{ {
@@ -163,6 +170,7 @@ exit:
return result; return result;
} }
status_t status_t
fs_readdir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *buf, fs_readdir(fs_volume *_vol, fs_vnode *_node, void *_cookie, struct dirent *buf,
size_t bufsize, uint32 *num) size_t bufsize, uint32 *num)
@@ -229,6 +237,7 @@ exit:
return result; return result;
} }
status_t status_t
fs_rewinddir(fs_volume *_vol, fs_vnode *vnode, void *_cookie) fs_rewinddir(fs_volume *_vol, fs_vnode *vnode, void *_cookie)
{ {
@@ -247,10 +256,10 @@ fs_rewinddir( fs_volume *_vol, fs_vnode *vnode, void *_cookie )
cookie->name[0] = 0; cookie->name[0] = 0;
result = B_NO_ERROR; result = B_NO_ERROR;
} }
ERRPRINT("fs_rewinddir - EXIT, result is %s\n", strerror(result)); ERRPRINT("fs_rewinddir - EXIT, result is %s\n", strerror(result));
UNLOCK_VOL(ns); UNLOCK_VOL(ns);
return result; return result;
} }