aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 29f1da761bbf..ad235d604a0b 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -103,6 +103,12 @@ cifs_read_super(struct super_block *sb, void *data,
103 if (cifs_sb == NULL) 103 if (cifs_sb == NULL)
104 return -ENOMEM; 104 return -ENOMEM;
105 105
106 rc = bdi_setup_and_register(&cifs_sb->bdi, "cifs", BDI_CAP_MAP_COPY);
107 if (rc) {
108 kfree(cifs_sb);
109 return rc;
110 }
111
106#ifdef CONFIG_CIFS_DFS_UPCALL 112#ifdef CONFIG_CIFS_DFS_UPCALL
107 /* copy mount params to sb for use in submounts */ 113 /* copy mount params to sb for use in submounts */
108 /* BB: should we move this after the mount so we 114 /* BB: should we move this after the mount so we
@@ -115,6 +121,7 @@ cifs_read_super(struct super_block *sb, void *data,
115 int len = strlen(data); 121 int len = strlen(data);
116 cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL); 122 cifs_sb->mountdata = kzalloc(len + 1, GFP_KERNEL);
117 if (cifs_sb->mountdata == NULL) { 123 if (cifs_sb->mountdata == NULL) {
124 bdi_destroy(&cifs_sb->bdi);
118 kfree(sb->s_fs_info); 125 kfree(sb->s_fs_info);
119 sb->s_fs_info = NULL; 126 sb->s_fs_info = NULL;
120 return -ENOMEM; 127 return -ENOMEM;
@@ -135,6 +142,7 @@ cifs_read_super(struct super_block *sb, void *data,
135 142
136 sb->s_magic = CIFS_MAGIC_NUMBER; 143 sb->s_magic = CIFS_MAGIC_NUMBER;
137 sb->s_op = &cifs_super_ops; 144 sb->s_op = &cifs_super_ops;
145 sb->s_bdi = &cifs_sb->bdi;
138/* if (cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512) 146/* if (cifs_sb->tcon->ses->server->maxBuf > MAX_CIFS_HDR_SIZE + 512)
139 sb->s_blocksize = 147 sb->s_blocksize =
140 cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */ 148 cifs_sb->tcon->ses->server->maxBuf - MAX_CIFS_HDR_SIZE; */
@@ -183,6 +191,7 @@ out_mount_failed:
183 } 191 }
184#endif 192#endif
185 unload_nls(cifs_sb->local_nls); 193 unload_nls(cifs_sb->local_nls);
194 bdi_destroy(&cifs_sb->bdi);
186 kfree(cifs_sb); 195 kfree(cifs_sb);
187 } 196 }
188 return rc; 197 return rc;
@@ -214,6 +223,7 @@ cifs_put_super(struct super_block *sb)
214#endif 223#endif
215 224
216 unload_nls(cifs_sb->local_nls); 225 unload_nls(cifs_sb->local_nls);
226 bdi_destroy(&cifs_sb->bdi);
217 kfree(cifs_sb); 227 kfree(cifs_sb);
218 228
219 unlock_kernel(); 229 unlock_kernel();
@@ -312,6 +322,7 @@ cifs_alloc_inode(struct super_block *sb)
312 cifs_inode->clientCanCacheRead = false; 322 cifs_inode->clientCanCacheRead = false;
313 cifs_inode->clientCanCacheAll = false; 323 cifs_inode->clientCanCacheAll = false;
314 cifs_inode->delete_pending = false; 324 cifs_inode->delete_pending = false;
325 cifs_inode->invalid_mapping = false;
315 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */ 326 cifs_inode->vfs_inode.i_blkbits = 14; /* 2**14 = CIFS_MAX_MSGSIZE */
316 cifs_inode->server_eof = 0; 327 cifs_inode->server_eof = 0;
317 328
@@ -638,7 +649,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
638 setting the revalidate time to zero */ 649 setting the revalidate time to zero */
639 CIFS_I(file->f_path.dentry->d_inode)->time = 0; 650 CIFS_I(file->f_path.dentry->d_inode)->time = 0;
640 651
641 retval = cifs_revalidate(file->f_path.dentry); 652 retval = cifs_revalidate_file(file);
642 if (retval < 0) 653 if (retval < 0)
643 return (loff_t)retval; 654 return (loff_t)retval;
644 } 655 }
@@ -758,7 +769,7 @@ const struct file_operations cifs_file_ops = {
758}; 769};
759 770
760const struct file_operations cifs_file_direct_ops = { 771const struct file_operations cifs_file_direct_ops = {
761 /* no mmap, no aio, no readv - 772 /* no aio, no readv -
762 BB reevaluate whether they can be done with directio, no cache */ 773 BB reevaluate whether they can be done with directio, no cache */
763 .read = cifs_user_read, 774 .read = cifs_user_read,
764 .write = cifs_user_write, 775 .write = cifs_user_write,
@@ -767,6 +778,7 @@ const struct file_operations cifs_file_direct_ops = {
767 .lock = cifs_lock, 778 .lock = cifs_lock,
768 .fsync = cifs_fsync, 779 .fsync = cifs_fsync,
769 .flush = cifs_flush, 780 .flush = cifs_flush,
781 .mmap = cifs_file_mmap,
770 .splice_read = generic_file_splice_read, 782 .splice_read = generic_file_splice_read,
771#ifdef CONFIG_CIFS_POSIX 783#ifdef CONFIG_CIFS_POSIX
772 .unlocked_ioctl = cifs_ioctl, 784 .unlocked_ioctl = cifs_ioctl,
@@ -806,6 +818,7 @@ const struct file_operations cifs_file_direct_nobrl_ops = {
806 .release = cifs_close, 818 .release = cifs_close,
807 .fsync = cifs_fsync, 819 .fsync = cifs_fsync,
808 .flush = cifs_flush, 820 .flush = cifs_flush,
821 .mmap = cifs_file_mmap,
809 .splice_read = generic_file_splice_read, 822 .splice_read = generic_file_splice_read,
810#ifdef CONFIG_CIFS_POSIX 823#ifdef CONFIG_CIFS_POSIX
811 .unlocked_ioctl = cifs_ioctl, 824 .unlocked_ioctl = cifs_ioctl,