aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ocfs2/dlm
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ocfs2/dlm')
-rw-r--r--fs/ocfs2/dlm/dlmcommon.h2
-rw-r--r--fs/ocfs2/dlm/dlmdomain.c9
-rw-r--r--fs/ocfs2/dlm/dlmfs.c10
-rw-r--r--fs/ocfs2/dlm/dlmlock.c4
-rw-r--r--fs/ocfs2/dlm/dlmmaster.c4
-rw-r--r--fs/ocfs2/dlm/dlmrecovery.c11
-rw-r--r--fs/ocfs2/dlm/userdlm.c10
7 files changed, 26 insertions, 24 deletions
diff --git a/fs/ocfs2/dlm/dlmcommon.h b/fs/ocfs2/dlm/dlmcommon.h
index fa968180b072..6b6ff76538c5 100644
--- a/fs/ocfs2/dlm/dlmcommon.h
+++ b/fs/ocfs2/dlm/dlmcommon.h
@@ -153,7 +153,7 @@ static inline struct hlist_head *dlm_lockres_hash(struct dlm_ctxt *dlm, unsigned
153 * called functions that cannot be directly called from the 153 * called functions that cannot be directly called from the
154 * net message handlers for some reason, usually because 154 * net message handlers for some reason, usually because
155 * they need to send net messages of their own. */ 155 * they need to send net messages of their own. */
156void dlm_dispatch_work(void *data); 156void dlm_dispatch_work(struct work_struct *work);
157 157
158struct dlm_lock_resource; 158struct dlm_lock_resource;
159struct dlm_work_item; 159struct dlm_work_item;
diff --git a/fs/ocfs2/dlm/dlmdomain.c b/fs/ocfs2/dlm/dlmdomain.c
index 8d1065f8b3bd..f0b25f2dd205 100644
--- a/fs/ocfs2/dlm/dlmdomain.c
+++ b/fs/ocfs2/dlm/dlmdomain.c
@@ -68,7 +68,8 @@ static void **dlm_alloc_pagevec(int pages)
68 goto out_free; 68 goto out_free;
69 69
70 mlog(0, "Allocated DLM hash pagevec; %d pages (%lu expected), %lu buckets per page\n", 70 mlog(0, "Allocated DLM hash pagevec; %d pages (%lu expected), %lu buckets per page\n",
71 pages, DLM_HASH_PAGES, (unsigned long)DLM_BUCKETS_PER_PAGE); 71 pages, (unsigned long)DLM_HASH_PAGES,
72 (unsigned long)DLM_BUCKETS_PER_PAGE);
72 return vec; 73 return vec;
73out_free: 74out_free:
74 dlm_free_pagevec(vec, i); 75 dlm_free_pagevec(vec, i);
@@ -919,7 +920,7 @@ static int dlm_try_to_join_domain(struct dlm_ctxt *dlm)
919 920
920 mlog_entry("%p", dlm); 921 mlog_entry("%p", dlm);
921 922
922 ctxt = kcalloc(1, sizeof(*ctxt), GFP_KERNEL); 923 ctxt = kzalloc(sizeof(*ctxt), GFP_KERNEL);
923 if (!ctxt) { 924 if (!ctxt) {
924 status = -ENOMEM; 925 status = -ENOMEM;
925 mlog_errno(status); 926 mlog_errno(status);
@@ -1222,7 +1223,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain,
1222 int i; 1223 int i;
1223 struct dlm_ctxt *dlm = NULL; 1224 struct dlm_ctxt *dlm = NULL;
1224 1225
1225 dlm = kcalloc(1, sizeof(*dlm), GFP_KERNEL); 1226 dlm = kzalloc(sizeof(*dlm), GFP_KERNEL);
1226 if (!dlm) { 1227 if (!dlm) {
1227 mlog_errno(-ENOMEM); 1228 mlog_errno(-ENOMEM);
1228 goto leave; 1229 goto leave;
@@ -1296,7 +1297,7 @@ static struct dlm_ctxt *dlm_alloc_ctxt(const char *domain,
1296 1297
1297 spin_lock_init(&dlm->work_lock); 1298 spin_lock_init(&dlm->work_lock);
1298 INIT_LIST_HEAD(&dlm->work_list); 1299 INIT_LIST_HEAD(&dlm->work_list);
1299 INIT_WORK(&dlm->dispatched_work, dlm_dispatch_work, dlm); 1300 INIT_WORK(&dlm->dispatched_work, dlm_dispatch_work);
1300 1301
1301 kref_init(&dlm->dlm_refs); 1302 kref_init(&dlm->dlm_refs);
1302 dlm->dlm_state = DLM_CTXT_NEW; 1303 dlm->dlm_state = DLM_CTXT_NEW;
diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c
index 16b8d1ba7066..b7f0ba97a1a2 100644
--- a/fs/ocfs2/dlm/dlmfs.c
+++ b/fs/ocfs2/dlm/dlmfs.c
@@ -66,7 +66,7 @@ static struct file_operations dlmfs_file_operations;
66static struct inode_operations dlmfs_dir_inode_operations; 66static struct inode_operations dlmfs_dir_inode_operations;
67static struct inode_operations dlmfs_root_inode_operations; 67static struct inode_operations dlmfs_root_inode_operations;
68static struct inode_operations dlmfs_file_inode_operations; 68static struct inode_operations dlmfs_file_inode_operations;
69static kmem_cache_t *dlmfs_inode_cache; 69static struct kmem_cache *dlmfs_inode_cache;
70 70
71struct workqueue_struct *user_dlm_worker; 71struct workqueue_struct *user_dlm_worker;
72 72
@@ -176,7 +176,7 @@ static ssize_t dlmfs_file_read(struct file *filp,
176 int bytes_left; 176 int bytes_left;
177 ssize_t readlen; 177 ssize_t readlen;
178 char *lvb_buf; 178 char *lvb_buf;
179 struct inode *inode = filp->f_dentry->d_inode; 179 struct inode *inode = filp->f_path.dentry->d_inode;
180 180
181 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 181 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n",
182 inode->i_ino, count, *ppos); 182 inode->i_ino, count, *ppos);
@@ -220,7 +220,7 @@ static ssize_t dlmfs_file_write(struct file *filp,
220 int bytes_left; 220 int bytes_left;
221 ssize_t writelen; 221 ssize_t writelen;
222 char *lvb_buf; 222 char *lvb_buf;
223 struct inode *inode = filp->f_dentry->d_inode; 223 struct inode *inode = filp->f_path.dentry->d_inode;
224 224
225 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n", 225 mlog(0, "inode %lu, count = %zu, *ppos = %llu\n",
226 inode->i_ino, count, *ppos); 226 inode->i_ino, count, *ppos);
@@ -257,7 +257,7 @@ static ssize_t dlmfs_file_write(struct file *filp,
257} 257}
258 258
259static void dlmfs_init_once(void *foo, 259static void dlmfs_init_once(void *foo,
260 kmem_cache_t *cachep, 260 struct kmem_cache *cachep,
261 unsigned long flags) 261 unsigned long flags)
262{ 262{
263 struct dlmfs_inode_private *ip = 263 struct dlmfs_inode_private *ip =
@@ -276,7 +276,7 @@ static struct inode *dlmfs_alloc_inode(struct super_block *sb)
276{ 276{
277 struct dlmfs_inode_private *ip; 277 struct dlmfs_inode_private *ip;
278 278
279 ip = kmem_cache_alloc(dlmfs_inode_cache, SLAB_NOFS); 279 ip = kmem_cache_alloc(dlmfs_inode_cache, GFP_NOFS);
280 if (!ip) 280 if (!ip)
281 return NULL; 281 return NULL;
282 282
diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
index 42a1b91979b5..e5ca3db197f6 100644
--- a/fs/ocfs2/dlm/dlmlock.c
+++ b/fs/ocfs2/dlm/dlmlock.c
@@ -408,13 +408,13 @@ struct dlm_lock * dlm_new_lock(int type, u8 node, u64 cookie,
408 struct dlm_lock *lock; 408 struct dlm_lock *lock;
409 int kernel_allocated = 0; 409 int kernel_allocated = 0;
410 410
411 lock = kcalloc(1, sizeof(*lock), GFP_NOFS); 411 lock = kzalloc(sizeof(*lock), GFP_NOFS);
412 if (!lock) 412 if (!lock)
413 return NULL; 413 return NULL;
414 414
415 if (!lksb) { 415 if (!lksb) {
416 /* zero memory only if kernel-allocated */ 416 /* zero memory only if kernel-allocated */
417 lksb = kcalloc(1, sizeof(*lksb), GFP_NOFS); 417 lksb = kzalloc(sizeof(*lksb), GFP_NOFS);
418 if (!lksb) { 418 if (!lksb) {
419 kfree(lock); 419 kfree(lock);
420 return NULL; 420 return NULL;
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
index f784177b6241..0ad872055cb3 100644
--- a/fs/ocfs2/dlm/dlmmaster.c
+++ b/fs/ocfs2/dlm/dlmmaster.c
@@ -221,7 +221,7 @@ EXPORT_SYMBOL_GPL(dlm_dump_all_mles);
221#endif /* 0 */ 221#endif /* 0 */
222 222
223 223
224static kmem_cache_t *dlm_mle_cache = NULL; 224static struct kmem_cache *dlm_mle_cache = NULL;
225 225
226 226
227static void dlm_mle_release(struct kref *kref); 227static void dlm_mle_release(struct kref *kref);
@@ -1939,7 +1939,7 @@ int dlm_dispatch_assert_master(struct dlm_ctxt *dlm,
1939 int ignore_higher, u8 request_from, u32 flags) 1939 int ignore_higher, u8 request_from, u32 flags)
1940{ 1940{
1941 struct dlm_work_item *item; 1941 struct dlm_work_item *item;
1942 item = kcalloc(1, sizeof(*item), GFP_NOFS); 1942 item = kzalloc(sizeof(*item), GFP_NOFS);
1943 if (!item) 1943 if (!item)
1944 return -ENOMEM; 1944 return -ENOMEM;
1945 1945
diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c
index 9d950d7cea38..367a11e9e2ed 100644
--- a/fs/ocfs2/dlm/dlmrecovery.c
+++ b/fs/ocfs2/dlm/dlmrecovery.c
@@ -153,9 +153,10 @@ static inline void dlm_reset_recovery(struct dlm_ctxt *dlm)
153} 153}
154 154
155/* Worker function used during recovery. */ 155/* Worker function used during recovery. */
156void dlm_dispatch_work(void *data) 156void dlm_dispatch_work(struct work_struct *work)
157{ 157{
158 struct dlm_ctxt *dlm = (struct dlm_ctxt *)data; 158 struct dlm_ctxt *dlm =
159 container_of(work, struct dlm_ctxt, dispatched_work);
159 LIST_HEAD(tmp_list); 160 LIST_HEAD(tmp_list);
160 struct list_head *iter, *iter2; 161 struct list_head *iter, *iter2;
161 struct dlm_work_item *item; 162 struct dlm_work_item *item;
@@ -756,7 +757,7 @@ static int dlm_init_recovery_area(struct dlm_ctxt *dlm, u8 dead_node)
756 } 757 }
757 BUG_ON(num == dead_node); 758 BUG_ON(num == dead_node);
758 759
759 ndata = kcalloc(1, sizeof(*ndata), GFP_NOFS); 760 ndata = kzalloc(sizeof(*ndata), GFP_NOFS);
760 if (!ndata) { 761 if (!ndata) {
761 dlm_destroy_recovery_area(dlm, dead_node); 762 dlm_destroy_recovery_area(dlm, dead_node);
762 return -ENOMEM; 763 return -ENOMEM;
@@ -841,7 +842,7 @@ int dlm_request_all_locks_handler(struct o2net_msg *msg, u32 len, void *data)
841 } 842 }
842 BUG_ON(lr->dead_node != dlm->reco.dead_node); 843 BUG_ON(lr->dead_node != dlm->reco.dead_node);
843 844
844 item = kcalloc(1, sizeof(*item), GFP_NOFS); 845 item = kzalloc(sizeof(*item), GFP_NOFS);
845 if (!item) { 846 if (!item) {
846 dlm_put(dlm); 847 dlm_put(dlm);
847 return -ENOMEM; 848 return -ENOMEM;
@@ -1322,7 +1323,7 @@ int dlm_mig_lockres_handler(struct o2net_msg *msg, u32 len, void *data)
1322 1323
1323 ret = -ENOMEM; 1324 ret = -ENOMEM;
1324 buf = kmalloc(be16_to_cpu(msg->data_len), GFP_NOFS); 1325 buf = kmalloc(be16_to_cpu(msg->data_len), GFP_NOFS);
1325 item = kcalloc(1, sizeof(*item), GFP_NOFS); 1326 item = kzalloc(sizeof(*item), GFP_NOFS);
1326 if (!buf || !item) 1327 if (!buf || !item)
1327 goto leave; 1328 goto leave;
1328 1329
diff --git a/fs/ocfs2/dlm/userdlm.c b/fs/ocfs2/dlm/userdlm.c
index eead48bbfac6..7d2f578b267d 100644
--- a/fs/ocfs2/dlm/userdlm.c
+++ b/fs/ocfs2/dlm/userdlm.c
@@ -171,15 +171,14 @@ static inline void user_dlm_grab_inode_ref(struct user_lock_res *lockres)
171 BUG(); 171 BUG();
172} 172}
173 173
174static void user_dlm_unblock_lock(void *opaque); 174static void user_dlm_unblock_lock(struct work_struct *work);
175 175
176static void __user_dlm_queue_lockres(struct user_lock_res *lockres) 176static void __user_dlm_queue_lockres(struct user_lock_res *lockres)
177{ 177{
178 if (!(lockres->l_flags & USER_LOCK_QUEUED)) { 178 if (!(lockres->l_flags & USER_LOCK_QUEUED)) {
179 user_dlm_grab_inode_ref(lockres); 179 user_dlm_grab_inode_ref(lockres);
180 180
181 INIT_WORK(&lockres->l_work, user_dlm_unblock_lock, 181 INIT_WORK(&lockres->l_work, user_dlm_unblock_lock);
182 lockres);
183 182
184 queue_work(user_dlm_worker, &lockres->l_work); 183 queue_work(user_dlm_worker, &lockres->l_work);
185 lockres->l_flags |= USER_LOCK_QUEUED; 184 lockres->l_flags |= USER_LOCK_QUEUED;
@@ -279,10 +278,11 @@ static inline void user_dlm_drop_inode_ref(struct user_lock_res *lockres)
279 iput(inode); 278 iput(inode);
280} 279}
281 280
282static void user_dlm_unblock_lock(void *opaque) 281static void user_dlm_unblock_lock(struct work_struct *work)
283{ 282{
284 int new_level, status; 283 int new_level, status;
285 struct user_lock_res *lockres = (struct user_lock_res *) opaque; 284 struct user_lock_res *lockres =
285 container_of(work, struct user_lock_res, l_work);
286 struct dlm_ctxt *dlm = dlm_ctxt_from_user_lockres(lockres); 286 struct dlm_ctxt *dlm = dlm_ctxt_from_user_lockres(lockres);
287 287
288 mlog(0, "processing lockres %.*s\n", lockres->l_namelen, 288 mlog(0, "processing lockres %.*s\n", lockres->l_namelen,