X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=fs%2Faffs%2Ffile.c;h=05b5e22de759e10513301ac7b441bc4127c3b492;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=9786e07cbef3cff828064950317c6a2298c3d6b8;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/fs/affs/file.c b/fs/affs/file.c index 9786e07cb..05b5e22de 100644 --- a/fs/affs/file.c +++ b/fs/affs/file.c @@ -12,24 +12,7 @@ * affs regular file handling primitives */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "affs.h" #if PAGE_SIZE < 4096 #error PAGE_SIZE must be at least 4096 @@ -39,14 +22,15 @@ static int affs_grow_extcache(struct inode *inode, u32 lc_idx); static struct buffer_head *affs_alloc_extblock(struct inode *inode, struct buffer_head *bh, u32 ext); static inline struct buffer_head *affs_get_extblock(struct inode *inode, u32 ext); static struct buffer_head *affs_get_extblock_slow(struct inode *inode, u32 ext); -static ssize_t affs_file_write(struct file *filp, const char __user *buf, size_t count, loff_t *ppos); static int affs_file_open(struct inode *inode, struct file *filp); static int affs_file_release(struct inode *inode, struct file *filp); -struct file_operations affs_file_operations = { +const struct file_operations affs_file_operations = { .llseek = generic_file_llseek, - .read = generic_file_read, - .write = affs_file_write, + .read = do_sync_read, + .aio_read = generic_file_aio_read, + .write = do_sync_write, + .aio_write = generic_file_aio_write, .mmap = generic_file_mmap, .open = affs_file_open, .release = affs_file_release, @@ -424,7 +408,7 @@ static sector_t _affs_bmap(struct address_space *mapping, sector_t block) { return generic_block_bmap(mapping,block,affs_get_block); } -struct address_space_operations affs_aops = { +const struct address_space_operations affs_aops = { .readpage = affs_readpage, .writepage = affs_writepage, .sync_page = block_sync_page, @@ -490,21 +474,6 @@ affs_getemptyblk_ino(struct inode *inode, int block) return ERR_PTR(err); } -static ssize_t -affs_file_write(struct file *file, const char __user *buf, - size_t count, loff_t *ppos) -{ - ssize_t retval; - - retval = generic_file_write (file, buf, count, ppos); - if (retval >0) { - struct inode *inode = file->f_dentry->d_inode; - inode->i_ctime = inode->i_mtime = CURRENT_TIME; - mark_inode_dirty(inode); - } - return retval; -} - static int affs_do_readpage_ofs(struct file *file, struct page *page, unsigned from, unsigned to) { @@ -792,7 +761,7 @@ out: goto done; } -struct address_space_operations affs_aops_ofs = { +const struct address_space_operations affs_aops_ofs = { .readpage = affs_readpage_ofs, //.writepage = affs_writepage_ofs, //.sync_page = affs_sync_page_ofs,