AFS: implement basic file write support
Implement support for writing to regular AFS files, including: (1) write (2) truncate (3) fsync, fdatasync (4) chmod, chown, chgrp, utime. AFS writeback attempts to batch writes into as chunks as large as it can manage up to the point that it writes back 65535 pages in one chunk or it meets a locked page. Furthermore, if a page has been written to using a particular key, then should another write to that page use some other key, the first write will be flushed before the second is allowed to take place. If the first write fails due to a security error, then the page will be scrapped and reread before the second write takes place. If a page is dirty and the callback on it is broken by the server, then the dirty data is not discarded (same behaviour as NFS). Shared-writable mappings are not supported by this patch. [akpm@linux-foundation.org: fix a bunch of warnings] Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
committed by
Linus Torvalds
parent
416351f28d
commit
31143d5d51
@@ -50,6 +50,7 @@ static const struct super_operations afs_super_ops = {
|
||||
.statfs = simple_statfs,
|
||||
.alloc_inode = afs_alloc_inode,
|
||||
.drop_inode = generic_delete_inode,
|
||||
.write_inode = afs_write_inode,
|
||||
.destroy_inode = afs_destroy_inode,
|
||||
.clear_inode = afs_clear_inode,
|
||||
.umount_begin = afs_umount_begin,
|
||||
@@ -66,7 +67,7 @@ enum {
|
||||
afs_opt_vol,
|
||||
};
|
||||
|
||||
static const match_table_t afs_options_list = {
|
||||
static match_table_t afs_options_list = {
|
||||
{ afs_opt_cell, "cell=%s" },
|
||||
{ afs_opt_rwpath, "rwpath" },
|
||||
{ afs_opt_vol, "vol=%s" },
|
||||
@@ -459,7 +460,9 @@ static void afs_i_init_once(void *_vnode, struct kmem_cache *cachep,
|
||||
init_waitqueue_head(&vnode->update_waitq);
|
||||
mutex_init(&vnode->permits_lock);
|
||||
mutex_init(&vnode->validate_lock);
|
||||
spin_lock_init(&vnode->writeback_lock);
|
||||
spin_lock_init(&vnode->lock);
|
||||
INIT_LIST_HEAD(&vnode->writebacks);
|
||||
INIT_WORK(&vnode->cb_broken_work, afs_broken_callback_work);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user