Many style changes.

The only functional change is that bfs_rename() now checks for '/' in the
target name (the VFS should do those things, but you never know as long
you haven't written it yourself :).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@2028 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2002-11-20 01:42:01 +00:00
parent 6396865dcd
commit b24d7c8bf7
@@ -249,7 +249,8 @@ bfs_mount(nspace_id nsid, const char *device, ulong flags, void *parms,
if ((status = volume->Mount(device, flags)) == B_OK) { if ((status = volume->Mount(device, flags)) == B_OK) {
*data = volume; *data = volume;
*rootID = volume->ToVnode(volume->Root()); *rootID = volume->ToVnode(volume->Root());
INFORM(("mounted \"%s\" (root node at %Ld, device = %s)\n",volume->Name(),*rootID,device)); INFORM(("mounted \"%s\" (root node at %Ld, device = %s)\n",
volume->Name(), *rootID, device));
} }
else else
delete volume; delete volume;
@@ -949,12 +950,13 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c
{ {
FUNCTION_START(("oldDir = %p, oldName = \"%s\", newDir = %p, newName = \"%s\"\n", _oldDir, oldName, _newDir, newName)); FUNCTION_START(("oldDir = %p, oldName = \"%s\", newDir = %p, newName = \"%s\"\n", _oldDir, oldName, _newDir, newName));
// there may be some more tests needed?! // there might be some more tests needed?!
if (_ns == NULL || _oldDir == NULL || _newDir == NULL if (_ns == NULL || _oldDir == NULL || _newDir == NULL
|| oldName == NULL || *oldName == '\0' || oldName == NULL || *oldName == '\0'
|| newName == NULL || *newName == '\0' || newName == NULL || *newName == '\0'
|| !strcmp(oldName, ".") || !strcmp(oldName, "..") || !strcmp(oldName, ".") || !strcmp(oldName, "..")
|| !strcmp(newName,".") || !strcmp(newName,"..")) || !strcmp(newName, ".") || !strcmp(newName, "..")
|| strchr(newName, '/') != NULL)
RETURN_ERROR(B_BAD_VALUE); RETURN_ERROR(B_BAD_VALUE);
Volume *volume = (Volume *)_ns; Volume *volume = (Volume *)_ns;
@@ -1074,7 +1076,8 @@ bfs_rename(void *_ns, void *_oldDir, const char *oldName, void *_newDir, const c
if (status == B_OK) { if (status == B_OK) {
transaction.Done(); transaction.Done();
notify_listener(B_ENTRY_MOVED,volume->ID(),oldDirectory->ID(),newDirectory->ID(),id,newName); notify_listener(B_ENTRY_MOVED, volume->ID(), oldDirectory->ID(),
newDirectory->ID(), id, newName);
return B_OK; return B_OK;
} }
} }
@@ -1705,7 +1708,8 @@ bfs_stat_attr(void *ns, void *_node, const char *name,struct attr_info *attrInfo
int int
bfs_write_attr(void *_ns, void *_node, const char *name, int type,const void *buffer, size_t *_length, off_t pos) bfs_write_attr(void *_ns, void *_node, const char *name, int type, const void *buffer,
size_t *_length, off_t pos)
{ {
FUNCTION_START(("name = \"%s\"\n",name)); FUNCTION_START(("name = \"%s\"\n",name));
@@ -1742,7 +1746,8 @@ bfs_write_attr(void *_ns, void *_node, const char *name, int type,const void *bu
int int
bfs_read_attr(void *_ns, void *_node, const char *name, int type,void *buffer, size_t *_length, off_t pos) bfs_read_attr(void *_ns, void *_node, const char *name, int type, void *buffer,
size_t *_length, off_t pos)
{ {
FUNCTION(); FUNCTION();
Inode *inode = (Inode *)_node; Inode *inode = (Inode *)_node;
@@ -1939,7 +1944,8 @@ bfs_stat_index(void *_ns, const char *name, struct index_info *indexInfo)
int int
bfs_open_query(void *_ns,const char *queryString,ulong flags,port_id port,long token,void **cookie) bfs_open_query(void *_ns, const char *queryString, ulong flags, port_id port,
long token, void **cookie)
{ {
FUNCTION(); FUNCTION();
if (_ns == NULL || queryString == NULL || cookie == NULL) if (_ns == NULL || queryString == NULL || cookie == NULL)