diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 43 |
1 files changed, 8 insertions, 35 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 43364361276e..84976cdbe713 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -256,7 +256,6 @@ cifs_alloc_inode(struct super_block *sb) | |||
256 | file data or metadata */ | 256 | file data or metadata */ |
257 | cifs_inode->clientCanCacheRead = FALSE; | 257 | cifs_inode->clientCanCacheRead = FALSE; |
258 | cifs_inode->clientCanCacheAll = FALSE; | 258 | cifs_inode->clientCanCacheAll = FALSE; |
259 | cifs_inode->vfs_inode.i_blksize = CIFS_MAX_MSGSIZE; | ||
260 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ | 259 | cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ |
261 | cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME; | 260 | cifs_inode->vfs_inode.i_flags = S_NOATIME | S_NOCMTIME; |
262 | INIT_LIST_HEAD(&cifs_inode->openFileList); | 261 | INIT_LIST_HEAD(&cifs_inode->openFileList); |
@@ -495,25 +494,13 @@ cifs_get_sb(struct file_system_type *fs_type, | |||
495 | return simple_set_mnt(mnt, sb); | 494 | return simple_set_mnt(mnt, sb); |
496 | } | 495 | } |
497 | 496 | ||
498 | static ssize_t cifs_file_writev(struct file *file, const struct iovec *iov, | 497 | static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, |
499 | unsigned long nr_segs, loff_t *ppos) | 498 | unsigned long nr_segs, loff_t pos) |
500 | { | ||
501 | struct inode *inode = file->f_dentry->d_inode; | ||
502 | ssize_t written; | ||
503 | |||
504 | written = generic_file_writev(file, iov, nr_segs, ppos); | ||
505 | if (!CIFS_I(inode)->clientCanCacheAll) | ||
506 | filemap_fdatawrite(inode->i_mapping); | ||
507 | return written; | ||
508 | } | ||
509 | |||
510 | static ssize_t cifs_file_aio_write(struct kiocb *iocb, const char __user *buf, | ||
511 | size_t count, loff_t pos) | ||
512 | { | 499 | { |
513 | struct inode *inode = iocb->ki_filp->f_dentry->d_inode; | 500 | struct inode *inode = iocb->ki_filp->f_dentry->d_inode; |
514 | ssize_t written; | 501 | ssize_t written; |
515 | 502 | ||
516 | written = generic_file_aio_write(iocb, buf, count, pos); | 503 | written = generic_file_aio_write(iocb, iov, nr_segs, pos); |
517 | if (!CIFS_I(inode)->clientCanCacheAll) | 504 | if (!CIFS_I(inode)->clientCanCacheAll) |
518 | filemap_fdatawrite(inode->i_mapping); | 505 | filemap_fdatawrite(inode->i_mapping); |
519 | return written; | 506 | return written; |
@@ -592,8 +579,6 @@ struct inode_operations cifs_symlink_inode_ops = { | |||
592 | const struct file_operations cifs_file_ops = { | 579 | const struct file_operations cifs_file_ops = { |
593 | .read = do_sync_read, | 580 | .read = do_sync_read, |
594 | .write = do_sync_write, | 581 | .write = do_sync_write, |
595 | .readv = generic_file_readv, | ||
596 | .writev = cifs_file_writev, | ||
597 | .aio_read = generic_file_aio_read, | 582 | .aio_read = generic_file_aio_read, |
598 | .aio_write = cifs_file_aio_write, | 583 | .aio_write = cifs_file_aio_write, |
599 | .open = cifs_open, | 584 | .open = cifs_open, |
@@ -635,8 +620,6 @@ const struct file_operations cifs_file_direct_ops = { | |||
635 | const struct file_operations cifs_file_nobrl_ops = { | 620 | const struct file_operations cifs_file_nobrl_ops = { |
636 | .read = do_sync_read, | 621 | .read = do_sync_read, |
637 | .write = do_sync_write, | 622 | .write = do_sync_write, |
638 | .readv = generic_file_readv, | ||
639 | .writev = cifs_file_writev, | ||
640 | .aio_read = generic_file_aio_read, | 623 | .aio_read = generic_file_aio_read, |
641 | .aio_write = cifs_file_aio_write, | 624 | .aio_write = cifs_file_aio_write, |
642 | .open = cifs_open, | 625 | .open = cifs_open, |
@@ -713,8 +696,7 @@ cifs_init_inodecache(void) | |||
713 | static void | 696 | static void |
714 | cifs_destroy_inodecache(void) | 697 | cifs_destroy_inodecache(void) |
715 | { | 698 | { |
716 | if (kmem_cache_destroy(cifs_inode_cachep)) | 699 | kmem_cache_destroy(cifs_inode_cachep); |
717 | printk(KERN_WARNING "cifs_inode_cache: error freeing\n"); | ||
718 | } | 700 | } |
719 | 701 | ||
720 | static int | 702 | static int |
@@ -792,13 +774,9 @@ static void | |||
792 | cifs_destroy_request_bufs(void) | 774 | cifs_destroy_request_bufs(void) |
793 | { | 775 | { |
794 | mempool_destroy(cifs_req_poolp); | 776 | mempool_destroy(cifs_req_poolp); |
795 | if (kmem_cache_destroy(cifs_req_cachep)) | 777 | kmem_cache_destroy(cifs_req_cachep); |
796 | printk(KERN_WARNING | ||
797 | "cifs_destroy_request_cache: error not all structures were freed\n"); | ||
798 | mempool_destroy(cifs_sm_req_poolp); | 778 | mempool_destroy(cifs_sm_req_poolp); |
799 | if (kmem_cache_destroy(cifs_sm_req_cachep)) | 779 | kmem_cache_destroy(cifs_sm_req_cachep); |
800 | printk(KERN_WARNING | ||
801 | "cifs_destroy_request_cache: cifs_small_rq free error\n"); | ||
802 | } | 780 | } |
803 | 781 | ||
804 | static int | 782 | static int |
@@ -833,13 +811,8 @@ static void | |||
833 | cifs_destroy_mids(void) | 811 | cifs_destroy_mids(void) |
834 | { | 812 | { |
835 | mempool_destroy(cifs_mid_poolp); | 813 | mempool_destroy(cifs_mid_poolp); |
836 | if (kmem_cache_destroy(cifs_mid_cachep)) | 814 | kmem_cache_destroy(cifs_mid_cachep); |
837 | printk(KERN_WARNING | 815 | kmem_cache_destroy(cifs_oplock_cachep); |
838 | "cifs_destroy_mids: error not all structures were freed\n"); | ||
839 | |||
840 | if (kmem_cache_destroy(cifs_oplock_cachep)) | ||
841 | printk(KERN_WARNING | ||
842 | "error not all oplock structures were freed\n"); | ||
843 | } | 816 | } |
844 | 817 | ||
845 | static int cifs_oplock_thread(void * dummyarg) | 818 | static int cifs_oplock_thread(void * dummyarg) |