diff options
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r-- | fs/cifs/cifsfs.c | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index d9f652a522a6..f2970136d17d 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -77,7 +77,11 @@ unsigned int cifs_max_pending = CIFS_MAX_REQ; | |||
77 | module_param(cifs_max_pending, int, 0); | 77 | module_param(cifs_max_pending, int, 0); |
78 | MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. " | 78 | MODULE_PARM_DESC(cifs_max_pending, "Simultaneous requests to server. " |
79 | "Default: 50 Range: 2 to 256"); | 79 | "Default: 50 Range: 2 to 256"); |
80 | 80 | unsigned short echo_retries = 5; | |
81 | module_param(echo_retries, ushort, 0644); | ||
82 | MODULE_PARM_DESC(echo_retries, "Number of echo attempts before giving up and " | ||
83 | "reconnecting server. Default: 5. 0 means " | ||
84 | "never reconnect."); | ||
81 | extern mempool_t *cifs_sm_req_poolp; | 85 | extern mempool_t *cifs_sm_req_poolp; |
82 | extern mempool_t *cifs_req_poolp; | 86 | extern mempool_t *cifs_req_poolp; |
83 | extern mempool_t *cifs_mid_poolp; | 87 | extern mempool_t *cifs_mid_poolp; |
@@ -596,10 +600,17 @@ static ssize_t cifs_file_aio_write(struct kiocb *iocb, const struct iovec *iov, | |||
596 | { | 600 | { |
597 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; | 601 | struct inode *inode = iocb->ki_filp->f_path.dentry->d_inode; |
598 | ssize_t written; | 602 | ssize_t written; |
603 | int rc; | ||
599 | 604 | ||
600 | written = generic_file_aio_write(iocb, iov, nr_segs, pos); | 605 | written = generic_file_aio_write(iocb, iov, nr_segs, pos); |
601 | if (!CIFS_I(inode)->clientCanCacheAll) | 606 | |
602 | filemap_fdatawrite(inode->i_mapping); | 607 | if (CIFS_I(inode)->clientCanCacheAll) |
608 | return written; | ||
609 | |||
610 | rc = filemap_fdatawrite(inode->i_mapping); | ||
611 | if (rc) | ||
612 | cFYI(1, "cifs_file_aio_write: %d rc on %p inode", rc, inode); | ||
613 | |||
603 | return written; | 614 | return written; |
604 | } | 615 | } |
605 | 616 | ||
@@ -729,6 +740,25 @@ const struct file_operations cifs_file_ops = { | |||
729 | .setlease = cifs_setlease, | 740 | .setlease = cifs_setlease, |
730 | }; | 741 | }; |
731 | 742 | ||
743 | const struct file_operations cifs_file_strict_ops = { | ||
744 | .read = do_sync_read, | ||
745 | .write = do_sync_write, | ||
746 | .aio_read = cifs_strict_readv, | ||
747 | .aio_write = cifs_strict_writev, | ||
748 | .open = cifs_open, | ||
749 | .release = cifs_close, | ||
750 | .lock = cifs_lock, | ||
751 | .fsync = cifs_strict_fsync, | ||
752 | .flush = cifs_flush, | ||
753 | .mmap = cifs_file_strict_mmap, | ||
754 | .splice_read = generic_file_splice_read, | ||
755 | .llseek = cifs_llseek, | ||
756 | #ifdef CONFIG_CIFS_POSIX | ||
757 | .unlocked_ioctl = cifs_ioctl, | ||
758 | #endif /* CONFIG_CIFS_POSIX */ | ||
759 | .setlease = cifs_setlease, | ||
760 | }; | ||
761 | |||
732 | const struct file_operations cifs_file_direct_ops = { | 762 | const struct file_operations cifs_file_direct_ops = { |
733 | /* no aio, no readv - | 763 | /* no aio, no readv - |
734 | BB reevaluate whether they can be done with directio, no cache */ | 764 | BB reevaluate whether they can be done with directio, no cache */ |
@@ -747,6 +777,7 @@ const struct file_operations cifs_file_direct_ops = { | |||
747 | .llseek = cifs_llseek, | 777 | .llseek = cifs_llseek, |
748 | .setlease = cifs_setlease, | 778 | .setlease = cifs_setlease, |
749 | }; | 779 | }; |
780 | |||
750 | const struct file_operations cifs_file_nobrl_ops = { | 781 | const struct file_operations cifs_file_nobrl_ops = { |
751 | .read = do_sync_read, | 782 | .read = do_sync_read, |
752 | .write = do_sync_write, | 783 | .write = do_sync_write, |
@@ -765,6 +796,24 @@ const struct file_operations cifs_file_nobrl_ops = { | |||
765 | .setlease = cifs_setlease, | 796 | .setlease = cifs_setlease, |
766 | }; | 797 | }; |
767 | 798 | ||
799 | const struct file_operations cifs_file_strict_nobrl_ops = { | ||
800 | .read = do_sync_read, | ||
801 | .write = do_sync_write, | ||
802 | .aio_read = cifs_strict_readv, | ||
803 | .aio_write = cifs_strict_writev, | ||
804 | .open = cifs_open, | ||
805 | .release = cifs_close, | ||
806 | .fsync = cifs_strict_fsync, | ||
807 | .flush = cifs_flush, | ||
808 | .mmap = cifs_file_strict_mmap, | ||
809 | .splice_read = generic_file_splice_read, | ||
810 | .llseek = cifs_llseek, | ||
811 | #ifdef CONFIG_CIFS_POSIX | ||
812 | .unlocked_ioctl = cifs_ioctl, | ||
813 | #endif /* CONFIG_CIFS_POSIX */ | ||
814 | .setlease = cifs_setlease, | ||
815 | }; | ||
816 | |||
768 | const struct file_operations cifs_file_direct_nobrl_ops = { | 817 | const struct file_operations cifs_file_direct_nobrl_ops = { |
769 | /* no mmap, no aio, no readv - | 818 | /* no mmap, no aio, no readv - |
770 | BB reevaluate whether they can be done with directio, no cache */ | 819 | BB reevaluate whether they can be done with directio, no cache */ |