aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorPavel Shilovsky <piastryyy@gmail.com>2010-12-12 05:11:13 -0500
committerSteve French <sfrench@us.ibm.com>2011-01-20 16:42:21 -0500
commit8be7e6ba142423e6ad98fed293c96f196f685229 (patch)
tree25bd7ce4aed4740082f0a472a8eed35127d9d61e /fs/cifs/cifsfs.c
parent4f8ba8a0c095933dd54a2c281750c8a85b329b26 (diff)
CIFS: Implement cifs_strict_fsync
Invalidate inode mapping if we don't have at least Level II oplock in cifs_strict_fsync. Also remove filemap_write_and_wait call from cifs_fsync because it is previously called from vfs_fsync_range. Add file operations' structures for strict cache mode. Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 99d777a03dd0..f6093e401c5a 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -733,6 +733,25 @@ const struct file_operations cifs_file_ops = {
733 .setlease = cifs_setlease, 733 .setlease = cifs_setlease,
734}; 734};
735 735
736const struct file_operations cifs_file_strict_ops = {
737 .read = do_sync_read,
738 .write = do_sync_write,
739 .aio_read = generic_file_aio_read,
740 .aio_write = cifs_file_aio_write,
741 .open = cifs_open,
742 .release = cifs_close,
743 .lock = cifs_lock,
744 .fsync = cifs_strict_fsync,
745 .flush = cifs_flush,
746 .mmap = cifs_file_mmap,
747 .splice_read = generic_file_splice_read,
748 .llseek = cifs_llseek,
749#ifdef CONFIG_CIFS_POSIX
750 .unlocked_ioctl = cifs_ioctl,
751#endif /* CONFIG_CIFS_POSIX */
752 .setlease = cifs_setlease,
753};
754
736const struct file_operations cifs_file_direct_ops = { 755const struct file_operations cifs_file_direct_ops = {
737 /* no aio, no readv - 756 /* no aio, no readv -
738 BB reevaluate whether they can be done with directio, no cache */ 757 BB reevaluate whether they can be done with directio, no cache */
@@ -751,6 +770,7 @@ const struct file_operations cifs_file_direct_ops = {
751 .llseek = cifs_llseek, 770 .llseek = cifs_llseek,
752 .setlease = cifs_setlease, 771 .setlease = cifs_setlease,
753}; 772};
773
754const struct file_operations cifs_file_nobrl_ops = { 774const struct file_operations cifs_file_nobrl_ops = {
755 .read = do_sync_read, 775 .read = do_sync_read,
756 .write = do_sync_write, 776 .write = do_sync_write,
@@ -769,6 +789,24 @@ const struct file_operations cifs_file_nobrl_ops = {
769 .setlease = cifs_setlease, 789 .setlease = cifs_setlease,
770}; 790};
771 791
792const struct file_operations cifs_file_strict_nobrl_ops = {
793 .read = do_sync_read,
794 .write = do_sync_write,
795 .aio_read = generic_file_aio_read,
796 .aio_write = cifs_file_aio_write,
797 .open = cifs_open,
798 .release = cifs_close,
799 .fsync = cifs_strict_fsync,
800 .flush = cifs_flush,
801 .mmap = cifs_file_mmap,
802 .splice_read = generic_file_splice_read,
803 .llseek = cifs_llseek,
804#ifdef CONFIG_CIFS_POSIX
805 .unlocked_ioctl = cifs_ioctl,
806#endif /* CONFIG_CIFS_POSIX */
807 .setlease = cifs_setlease,
808};
809
772const struct file_operations cifs_file_direct_nobrl_ops = { 810const struct file_operations cifs_file_direct_nobrl_ops = {
773 /* no mmap, no aio, no readv - 811 /* no mmap, no aio, no readv -
774 BB reevaluate whether they can be done with directio, no cache */ 812 BB reevaluate whether they can be done with directio, no cache */