aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r--fs/ocfs2/super.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c
index 76b46ebbb10c..4bf39540e652 100644
--- a/fs/ocfs2/super.c
+++ b/fs/ocfs2/super.c
@@ -68,9 +68,7 @@
68 68
69#include "buffer_head_io.h" 69#include "buffer_head_io.h"
70 70
71static kmem_cache_t *ocfs2_inode_cachep = NULL; 71static struct kmem_cache *ocfs2_inode_cachep = NULL;
72
73kmem_cache_t *ocfs2_lock_cache = NULL;
74 72
75/* OCFS2 needs to schedule several differnt types of work which 73/* OCFS2 needs to schedule several differnt types of work which
76 * require cluster locking, disk I/O, recovery waits, etc. Since these 74 * require cluster locking, disk I/O, recovery waits, etc. Since these
@@ -141,6 +139,7 @@ enum {
141 Opt_hb_local, 139 Opt_hb_local,
142 Opt_data_ordered, 140 Opt_data_ordered,
143 Opt_data_writeback, 141 Opt_data_writeback,
142 Opt_atime_quantum,
144 Opt_err, 143 Opt_err,
145}; 144};
146 145
@@ -154,6 +153,7 @@ static match_table_t tokens = {
154 {Opt_hb_local, OCFS2_HB_LOCAL}, 153 {Opt_hb_local, OCFS2_HB_LOCAL},
155 {Opt_data_ordered, "data=ordered"}, 154 {Opt_data_ordered, "data=ordered"},
156 {Opt_data_writeback, "data=writeback"}, 155 {Opt_data_writeback, "data=writeback"},
156 {Opt_atime_quantum, "atime_quantum=%u"},
157 {Opt_err, NULL} 157 {Opt_err, NULL}
158}; 158};
159 159
@@ -303,7 +303,7 @@ static struct inode *ocfs2_alloc_inode(struct super_block *sb)
303{ 303{
304 struct ocfs2_inode_info *oi; 304 struct ocfs2_inode_info *oi;
305 305
306 oi = kmem_cache_alloc(ocfs2_inode_cachep, SLAB_NOFS); 306 oi = kmem_cache_alloc(ocfs2_inode_cachep, GFP_NOFS);
307 if (!oi) 307 if (!oi)
308 return NULL; 308 return NULL;
309 309
@@ -707,6 +707,7 @@ static int ocfs2_parse_options(struct super_block *sb,
707 while ((p = strsep(&options, ",")) != NULL) { 707 while ((p = strsep(&options, ",")) != NULL) {
708 int token, option; 708 int token, option;
709 substring_t args[MAX_OPT_ARGS]; 709 substring_t args[MAX_OPT_ARGS];
710 struct ocfs2_super * osb = OCFS2_SB(sb);
710 711
711 if (!*p) 712 if (!*p)
712 continue; 713 continue;
@@ -747,6 +748,16 @@ static int ocfs2_parse_options(struct super_block *sb,
747 case Opt_data_writeback: 748 case Opt_data_writeback:
748 *mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK; 749 *mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK;
749 break; 750 break;
751 case Opt_atime_quantum:
752 if (match_int(&args[0], &option)) {
753 status = 0;
754 goto bail;
755 }
756 if (option >= 0)
757 osb->s_atime_quantum = option;
758 else
759 osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
760 break;
750 default: 761 default:
751 mlog(ML_ERROR, 762 mlog(ML_ERROR,
752 "Unrecognized mount option \"%s\" " 763 "Unrecognized mount option \"%s\" "
@@ -867,7 +878,7 @@ static int ocfs2_statfs(struct dentry *dentry, struct kstatfs *buf)
867 goto bail; 878 goto bail;
868 } 879 }
869 880
870 status = ocfs2_meta_lock(inode, NULL, &bh, 0); 881 status = ocfs2_meta_lock(inode, &bh, 0);
871 if (status < 0) { 882 if (status < 0) {
872 mlog_errno(status); 883 mlog_errno(status);
873 goto bail; 884 goto bail;
@@ -903,7 +914,7 @@ bail:
903} 914}
904 915
905static void ocfs2_inode_init_once(void *data, 916static void ocfs2_inode_init_once(void *data,
906 kmem_cache_t *cachep, 917 struct kmem_cache *cachep,
907 unsigned long flags) 918 unsigned long flags)
908{ 919{
909 struct ocfs2_inode_info *oi = data; 920 struct ocfs2_inode_info *oi = data;
@@ -914,9 +925,7 @@ static void ocfs2_inode_init_once(void *data,
914 oi->ip_open_count = 0; 925 oi->ip_open_count = 0;
915 spin_lock_init(&oi->ip_lock); 926 spin_lock_init(&oi->ip_lock);
916 ocfs2_extent_map_init(&oi->vfs_inode); 927 ocfs2_extent_map_init(&oi->vfs_inode);
917 INIT_LIST_HEAD(&oi->ip_handle_list);
918 INIT_LIST_HEAD(&oi->ip_io_markers); 928 INIT_LIST_HEAD(&oi->ip_io_markers);
919 oi->ip_handle = NULL;
920 oi->ip_created_trans = 0; 929 oi->ip_created_trans = 0;
921 oi->ip_last_trans = 0; 930 oi->ip_last_trans = 0;
922 oi->ip_dir_start_lookup = 0; 931 oi->ip_dir_start_lookup = 0;
@@ -948,14 +957,6 @@ static int ocfs2_initialize_mem_caches(void)
948 if (!ocfs2_inode_cachep) 957 if (!ocfs2_inode_cachep)
949 return -ENOMEM; 958 return -ENOMEM;
950 959
951 ocfs2_lock_cache = kmem_cache_create("ocfs2_lock",
952 sizeof(struct ocfs2_journal_lock),
953 0,
954 SLAB_HWCACHE_ALIGN,
955 NULL, NULL);
956 if (!ocfs2_lock_cache)
957 return -ENOMEM;
958
959 return 0; 960 return 0;
960} 961}
961 962
@@ -963,11 +964,8 @@ static void ocfs2_free_mem_caches(void)
963{ 964{
964 if (ocfs2_inode_cachep) 965 if (ocfs2_inode_cachep)
965 kmem_cache_destroy(ocfs2_inode_cachep); 966 kmem_cache_destroy(ocfs2_inode_cachep);
966 if (ocfs2_lock_cache)
967 kmem_cache_destroy(ocfs2_lock_cache);
968 967
969 ocfs2_inode_cachep = NULL; 968 ocfs2_inode_cachep = NULL;
970 ocfs2_lock_cache = NULL;
971} 969}
972 970
973static int ocfs2_get_sector(struct super_block *sb, 971static int ocfs2_get_sector(struct super_block *sb,
@@ -1280,6 +1278,8 @@ static int ocfs2_initialize_super(struct super_block *sb,
1280 init_waitqueue_head(&osb->checkpoint_event); 1278 init_waitqueue_head(&osb->checkpoint_event);
1281 atomic_set(&osb->needs_checkpoint, 0); 1279 atomic_set(&osb->needs_checkpoint, 0);
1282 1280
1281 osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM;
1282
1283 osb->node_num = O2NM_INVALID_NODE_NUM; 1283 osb->node_num = O2NM_INVALID_NODE_NUM;
1284 osb->slot_num = OCFS2_INVALID_SLOT; 1284 osb->slot_num = OCFS2_INVALID_SLOT;
1285 1285
@@ -1365,7 +1365,7 @@ static int ocfs2_initialize_super(struct super_block *sb,
1365 spin_lock_init(&journal->j_lock); 1365 spin_lock_init(&journal->j_lock);
1366 journal->j_trans_id = (unsigned long) 1; 1366 journal->j_trans_id = (unsigned long) 1;
1367 INIT_LIST_HEAD(&journal->j_la_cleanups); 1367 INIT_LIST_HEAD(&journal->j_la_cleanups);
1368 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery, osb); 1368 INIT_WORK(&journal->j_recovery_work, ocfs2_complete_recovery);
1369 journal->j_state = OCFS2_JOURNAL_FREE; 1369 journal->j_state = OCFS2_JOURNAL_FREE;
1370 1370
1371 /* get some pseudo constants for clustersize bits */ 1371 /* get some pseudo constants for clustersize bits */
@@ -1674,7 +1674,7 @@ void __ocfs2_error(struct super_block *sb,
1674 va_list args; 1674 va_list args;
1675 1675
1676 va_start(args, fmt); 1676 va_start(args, fmt);
1677 vsprintf(error_buf, fmt, args); 1677 vsnprintf(error_buf, sizeof(error_buf), fmt, args);
1678 va_end(args); 1678 va_end(args);
1679 1679
1680 /* Not using mlog here because we want to show the actual 1680 /* Not using mlog here because we want to show the actual
@@ -1695,7 +1695,7 @@ void __ocfs2_abort(struct super_block* sb,
1695 va_list args; 1695 va_list args;
1696 1696
1697 va_start(args, fmt); 1697 va_start(args, fmt);
1698 vsprintf(error_buf, fmt, args); 1698 vsnprintf(error_buf, sizeof(error_buf), fmt, args);
1699 va_end(args); 1699 va_end(args);
1700 1700
1701 printk(KERN_CRIT "OCFS2: abort (device %s): %s: %s\n", 1701 printk(KERN_CRIT "OCFS2: abort (device %s): %s: %s\n",