On Sun, Oct 29, 2000 at 03:15:57PM +0100, Andreas Gruenbacher wrote:
> One of the issues raised was that it's important to be able to manipulate
> multiple EA's at once. The reason for this was to reduce system call
> overhead.
The need is probably the same for reading multiple small files,
retrieving stat-data for multiple files and so on. Maybe we could solve
it more generally?
What about a syscall/ioctl VFS_SANDBOX (yes, it's Hans' idea, only
different syntax):
vfs_sandbox(void *vfs_command,long command_buf_size,long *result,int flags);
vfs_command should be something like:
int command_type;
int argument_list_length;
command-specific argument length here;
command_buf_size is the size of the vfs_command buffer (for all the
commands)
The result of each command will be put in result.
Possible flags can be: VFS_TRANSACTION, VFS_ATOMIC, VFS_ABORT_AT_ERROR
Possible commands can be:
VFS_READ_FROM_FILE: takes char *filename, void *buffer, size_t off,
size_t length
(will do open, [seek], read and close)
VFS_WRITE_TO_FILE: ditto
VFS_STAT_FILE: takes char *filename, struct stat *buf
VFS_SET_EA:
VFS_GET_EA:
.....
This will make it possible to do multiple io-operations in one syscall,
and if the filesystem supports it, in one transaction and possible
atomic.
With some additions to libc, it should be possible to do:
struct transaction *t;
struct stat statbuf;
void buffer[1024];
long result[4];
t=start_transaction(&result, VFS_TRANSACTION);
vfs_stat_file(t, "/tmp/foo", &statbuf);
vfs_read_from_file(t, "/tmp/foo", buffer, 10, 1023);
vfs_write_to_file(t, "/tmp/bar", buffer, 10, 1023);
vfs_write_to_file(t, "/tmp/bar2", buffer, 10, 1023);
commit_transaction(t);
And I can be sure both bar and bar2 are both updated in the same
transaction.
That said, I don't need how urgent the need to reduce the number of
syscall really is.
--
Ragnar Kj�rstad
Big Storage
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to [EMAIL PROTECTED]