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.c35
1 files changed, 30 insertions, 5 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 4c075177c8b6..5ac541a30c1d 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -47,6 +47,7 @@
47#include <linux/key-type.h> 47#include <linux/key-type.h>
48#include "dns_resolve.h" 48#include "dns_resolve.h"
49#include "cifs_spnego.h" 49#include "cifs_spnego.h"
50#include "fscache.h"
50#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ 51#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
51 52
52int cifsFYI = 0; 53int cifsFYI = 0;
@@ -329,6 +330,12 @@ cifs_destroy_inode(struct inode *inode)
329} 330}
330 331
331static void 332static void
333cifs_clear_inode(struct inode *inode)
334{
335 cifs_fscache_release_inode_cookie(inode);
336}
337
338static void
332cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) 339cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server)
333{ 340{
334 seq_printf(s, ",addr="); 341 seq_printf(s, ",addr=");
@@ -473,14 +480,25 @@ static int cifs_remount(struct super_block *sb, int *flags, char *data)
473 return 0; 480 return 0;
474} 481}
475 482
483void cifs_drop_inode(struct inode *inode)
484{
485 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
486
487 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM)
488 return generic_drop_inode(inode);
489
490 return generic_delete_inode(inode);
491}
492
476static const struct super_operations cifs_super_ops = { 493static const struct super_operations cifs_super_ops = {
477 .put_super = cifs_put_super, 494 .put_super = cifs_put_super,
478 .statfs = cifs_statfs, 495 .statfs = cifs_statfs,
479 .alloc_inode = cifs_alloc_inode, 496 .alloc_inode = cifs_alloc_inode,
480 .destroy_inode = cifs_destroy_inode, 497 .destroy_inode = cifs_destroy_inode,
481/* .drop_inode = generic_delete_inode, 498 .drop_inode = cifs_drop_inode,
482 .delete_inode = cifs_delete_inode, */ /* Do not need above two 499 .clear_inode = cifs_clear_inode,
483 functions unless later we add lazy close of inodes or unless the 500/* .delete_inode = cifs_delete_inode, */ /* Do not need above
501 function unless later we add lazy close of inodes or unless the
484 kernel forgets to call us with the same number of releases (closes) 502 kernel forgets to call us with the same number of releases (closes)
485 as opens */ 503 as opens */
486 .show_options = cifs_show_options, 504 .show_options = cifs_show_options,
@@ -892,6 +910,10 @@ init_cifs(void)
892 cFYI(1, "cifs_max_pending set to max of 256"); 910 cFYI(1, "cifs_max_pending set to max of 256");
893 } 911 }
894 912
913 rc = cifs_fscache_register();
914 if (rc)
915 goto out;
916
895 rc = cifs_init_inodecache(); 917 rc = cifs_init_inodecache();
896 if (rc) 918 if (rc)
897 goto out_clean_proc; 919 goto out_clean_proc;
@@ -913,7 +935,7 @@ init_cifs(void)
913 goto out_unregister_filesystem; 935 goto out_unregister_filesystem;
914#endif 936#endif
915#ifdef CONFIG_CIFS_DFS_UPCALL 937#ifdef CONFIG_CIFS_DFS_UPCALL
916 rc = register_key_type(&key_type_dns_resolver); 938 rc = cifs_init_dns_resolver();
917 if (rc) 939 if (rc)
918 goto out_unregister_key_type; 940 goto out_unregister_key_type;
919#endif 941#endif
@@ -936,6 +958,8 @@ init_cifs(void)
936 cifs_destroy_inodecache(); 958 cifs_destroy_inodecache();
937 out_clean_proc: 959 out_clean_proc:
938 cifs_proc_clean(); 960 cifs_proc_clean();
961 cifs_fscache_unregister();
962 out:
939 return rc; 963 return rc;
940} 964}
941 965
@@ -944,9 +968,10 @@ exit_cifs(void)
944{ 968{
945 cFYI(DBG2, "exit_cifs"); 969 cFYI(DBG2, "exit_cifs");
946 cifs_proc_clean(); 970 cifs_proc_clean();
971 cifs_fscache_unregister();
947#ifdef CONFIG_CIFS_DFS_UPCALL 972#ifdef CONFIG_CIFS_DFS_UPCALL
948 cifs_dfs_release_automount_timer(); 973 cifs_dfs_release_automount_timer();
949 unregister_key_type(&key_type_dns_resolver); 974 cifs_exit_dns_resolver();
950#endif 975#endif
951#ifdef CONFIG_CIFS_UPCALL 976#ifdef CONFIG_CIFS_UPCALL
952 unregister_key_type(&cifs_spnego_key_type); 977 unregister_key_type(&cifs_spnego_key_type);