[PATCH] mark struct file_operations const 6
[safe/jmp/linux-2.6] / fs / gfs2 / locking / dlm / plock.c
index 263636b..1dd4215 100644 (file)
@@ -8,6 +8,7 @@
 
 #include <linux/miscdevice.h>
 #include <linux/lock_dlm_plock.h>
+#include <linux/poll.h>
 
 #include "lock_dlm.h"
 
@@ -58,10 +59,10 @@ static void send_op(struct plock_op *op)
        wake_up(&send_wq);
 }
 
-int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
+int gdlm_plock(void *lockspace, struct lm_lockname *name,
               struct file *file, int cmd, struct file_lock *fl)
 {
-       struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
+       struct gdlm_ls *ls = lockspace;
        struct plock_op *op;
        int rv;
 
@@ -102,10 +103,10 @@ int gdlm_plock(lm_lockspace_t *lockspace, struct lm_lockname *name,
        return rv;
 }
 
-int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
+int gdlm_punlock(void *lockspace, struct lm_lockname *name,
                 struct file *file, struct file_lock *fl)
 {
-       struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
+       struct gdlm_ls *ls = lockspace;
        struct plock_op *op;
        int rv;
 
@@ -141,10 +142,10 @@ int gdlm_punlock(lm_lockspace_t *lockspace, struct lm_lockname *name,
        return rv;
 }
 
-int gdlm_plock_get(lm_lockspace_t *lockspace, struct lm_lockname *name,
+int gdlm_plock_get(void *lockspace, struct lm_lockname *name,
                   struct file *file, struct file_lock *fl)
 {
-       struct gdlm_ls *ls = (struct gdlm_ls *) lockspace;
+       struct gdlm_ls *ls = lockspace;
        struct plock_op *op;
        int rv;
 
@@ -231,8 +232,7 @@ static ssize_t dev_write(struct file *file, const char __user *u, size_t count,
 
        spin_lock(&ops_lock);
        list_for_each_entry(op, &recv_list, list) {
-               if (op->info.fsid == info.fsid &&
-                   op->info.number == info.number &&
+               if (op->info.fsid == info.fsid && op->info.number == info.number &&
                    op->info.owner == info.owner) {
                        list_del_init(&op->list);
                        found = 1;
@@ -264,7 +264,7 @@ static unsigned int dev_poll(struct file *file, poll_table *wait)
        return 0;
 }
 
-static struct file_operations dev_fops = {
+static const struct file_operations dev_fops = {
        .read    = dev_read,
        .write   = dev_write,
        .poll    = dev_poll,