Index: uspace/srv/vfs/vfs.h
===================================================================
--- uspace/srv/vfs/vfs.h	(revision 1090b8c5d547b44cb82f921d66261080be81ccc2)
+++ uspace/srv/vfs/vfs.h	(revision 05b99126815087aa02fb9ab307d0c064b1473859)
@@ -29,5 +29,5 @@
 /** @addtogroup fs
  * @{
- */ 
+ */
 
 #ifndef VFS_VFS_H_
@@ -41,54 +41,10 @@
 #include <devmap.h>
 #include <bool.h>
+#include <ipc/vfs.h>
 
 // FIXME: according to CONFIG_DEBUG
-// #define dprintf(...)	printf(__VA_ARGS__)
+// #define dprintf(...)  printf(__VA_ARGS__)
 
 #define dprintf(...)
-
-#define VFS_FIRST	IPC_FIRST_USER_METHOD
-
-/* Basic types. */
-typedef int16_t fs_handle_t;
-typedef uint32_t fs_index_t;
-
-typedef enum {
-	VFS_READ = VFS_FIRST,
-	VFS_WRITE,
-	VFS_TRUNCATE,
-	VFS_MOUNT,
-	VFS_UNMOUNT,
-	VFS_LAST_CMN,	/* keep this the last member of this enum */
-} vfs_request_cmn_t;
-
-typedef enum {
-	VFS_LOOKUP = VFS_LAST_CMN,
-	VFS_MOUNTED,
-	VFS_DESTROY,
-	VFS_LAST_CLNT,	/* keep this the last member of this enum */
-} vfs_request_clnt_t;
-
-typedef enum {
-	VFS_REGISTER = VFS_LAST_CMN,
-	VFS_OPEN,
-	VFS_CLOSE,
-	VFS_SEEK,
-	VFS_MKDIR,
-	VFS_UNLINK,
-	VFS_RENAME,
-	VFS_LAST_SRV,	/* keep this the last member of this enum */
-} vfs_request_srv_t;
-
-#define FS_NAME_MAXLEN	20
-
-/**
- * A structure like this is passed to VFS by each individual FS upon its
- * registration. It assosiates a human-readable identifier with each
- * registered FS.
- */
-typedef struct {
-	/** Unique identifier of the fs. */
-	char name[FS_NAME_MAXLEN + 1];
-} vfs_info_t;
 
 /**
@@ -106,6 +62,6 @@
  * VFS_PAIR uniquely represents a file system instance.
  */
-#define VFS_PAIR		\
-	fs_handle_t fs_handle;	\
+#define VFS_PAIR \
+	fs_handle_t fs_handle; \
 	dev_handle_t dev_handle;
 
@@ -117,6 +73,6 @@
  *		IPC reply.
  */
-#define VFS_TRIPLET	\
-	VFS_PAIR;	\
+#define VFS_TRIPLET \
+	VFS_PAIR; \
 	fs_index_t index;
 
@@ -128,43 +84,4 @@
 	VFS_TRIPLET;
 } vfs_triplet_t;
-
-/*
- * Lookup flags.
- */
-/**
- * No lookup flags used.
- */
-#define L_NONE		0
-/**
- * Lookup will succeed only if the object is a regular file.  If L_CREATE is
- * specified, an empty file will be created. This flag is mutually exclusive
- * with L_DIRECTORY.
- */
-#define L_FILE		1
-/**
- * Lookup wil succeed only if the object is a directory. If L_CREATE is
- * specified, an empty directory will be created. This flag is mutually
- * exclusive with L_FILE.
- */
-#define L_DIRECTORY	2
-/**
- * When used with L_CREATE, L_EXCLUSIVE will cause the lookup to fail if the
- * object already exists. L_EXCLUSIVE is implied when L_DIRECTORY is used.
- */
-#define L_EXCLUSIVE	4
-/**
- * L_CREATE is used for creating both regular files and directories.
- */
-#define L_CREATE	8
-/**
- * L_LINK is used for linking to an already existing nodes.
- */
-#define L_LINK		16
-/**
- * L_UNLINK is used to remove leaves from the file system namespace. This flag
- * cannot be passed directly by the client, but will be set by VFS during
- * VFS_UNLINK.
- */
-#define L_UNLINK	32	
 
 typedef enum vfs_node_type {
@@ -235,8 +152,4 @@
 extern vfs_pair_t rootfs;	/**< Root file system. */
 
-#define MAX_PATH_LEN		(64 * 1024)
-
-#define PLB_SIZE		(2 * MAX_PATH_LEN)
-
 /** Each instance of this type describes one path lookup in progress. */
 typedef struct {
@@ -260,6 +173,7 @@
 extern fs_handle_t fs_name_to_handle(char *, bool);
 
-extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *, vfs_pair_t *,
-    ...);
+extern int vfs_lookup_internal(char *, int, vfs_lookup_res_t *,
+    vfs_pair_t *, ...);
+extern int vfs_open_node_internal(vfs_lookup_res_t *);
 
 extern bool vfs_nodes_init(void);
@@ -284,4 +198,8 @@
 extern void vfs_mount(ipc_callid_t, ipc_call_t *);
 extern void vfs_open(ipc_callid_t, ipc_call_t *);
+extern void vfs_open_node(ipc_callid_t, ipc_call_t *);
+extern void vfs_device(ipc_callid_t, ipc_call_t *);
+extern void vfs_sync(ipc_callid_t, ipc_call_t *);
+extern void vfs_node(ipc_callid_t, ipc_call_t *);
 extern void vfs_close(ipc_callid_t, ipc_call_t *);
 extern void vfs_read(ipc_callid_t, ipc_call_t *);
