X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Focfs2%2Fdlm%2Fdlmfs.c;h=61a000f8524c7aab2785a0c487c1ebe5d5fadf0a;hb=3fabc55f34b72720e8a10aa442bd3415a211edb3;hp=fd8cb1badc9b9db082219a170f8240c3675cf72a;hpb=0b662c64840fb281e5948ab6f9d60f84817277d0;p=linux-2.6-omap-h63xx.git diff --git a/fs/ocfs2/dlm/dlmfs.c b/fs/ocfs2/dlm/dlmfs.c index fd8cb1badc9..61a000f8524 100644 --- a/fs/ocfs2/dlm/dlmfs.c +++ b/fs/ocfs2/dlm/dlmfs.c @@ -60,6 +60,8 @@ #define MLOG_MASK_PREFIX ML_DLMFS #include "cluster/masklog.h" +#include "ocfs2_lockingver.h" + static const struct super_operations dlmfs_ops; static const struct file_operations dlmfs_file_operations; static const struct inode_operations dlmfs_dir_inode_operations; @@ -69,6 +71,16 @@ static struct kmem_cache *dlmfs_inode_cache; struct workqueue_struct *user_dlm_worker; +/* + * This is the userdlmfs locking protocol version. + * + * See fs/ocfs2/dlmglue.c for more details on locking versions. + */ +static const struct dlm_protocol_version user_locking_protocol = { + .pv_major = OCFS2_LOCKING_PROTOCOL_MAJOR, + .pv_minor = OCFS2_LOCKING_PROTOCOL_MINOR, +}; + /* * decodes a set of open flags into a valid lock level and a set of flags. * returns < 0 if we have invalid flags @@ -255,9 +267,8 @@ static ssize_t dlmfs_file_write(struct file *filp, return writelen; } -static void dlmfs_init_once(void *foo, - struct kmem_cache *cachep, - unsigned long flags) +static void dlmfs_init_once(struct kmem_cache *cachep, + void *foo) { struct dlmfs_inode_private *ip = (struct dlmfs_inode_private *) foo; @@ -417,6 +428,7 @@ static int dlmfs_mkdir(struct inode * dir, struct qstr *domain = &dentry->d_name; struct dlmfs_inode_private *ip; struct dlm_ctxt *dlm; + struct dlm_protocol_version proto = user_locking_protocol; mlog(0, "mkdir %.*s\n", domain->len, domain->name); @@ -436,7 +448,7 @@ static int dlmfs_mkdir(struct inode * dir, ip = DLMFS_I(inode); - dlm = user_dlm_register_context(domain); + dlm = user_dlm_register_context(domain, &proto); if (IS_ERR(dlm)) { status = PTR_ERR(dlm); mlog(ML_ERROR, "Error %d could not register domain \"%.*s\"\n", @@ -588,13 +600,17 @@ static int __init init_dlmfs_fs(void) dlmfs_print_version(); + status = bdi_init(&dlmfs_backing_dev_info); + if (status) + return status; + dlmfs_inode_cache = kmem_cache_create("dlmfs_inode_cache", sizeof(struct dlmfs_inode_private), 0, (SLAB_HWCACHE_ALIGN|SLAB_RECLAIM_ACCOUNT| SLAB_MEM_SPREAD), - dlmfs_init_once, NULL); + dlmfs_init_once); if (!dlmfs_inode_cache) - return -ENOMEM; + goto bail; cleanup_inode = 1; user_dlm_worker = create_singlethread_workqueue("user_dlm"); @@ -611,6 +627,7 @@ bail: kmem_cache_destroy(dlmfs_inode_cache); if (cleanup_worker) destroy_workqueue(user_dlm_worker); + bdi_destroy(&dlmfs_backing_dev_info); } else printk("OCFS2 User DLM kernel interface loaded\n"); return status; @@ -624,6 +641,8 @@ static void __exit exit_dlmfs_fs(void) destroy_workqueue(user_dlm_worker); kmem_cache_destroy(dlmfs_inode_cache); + + bdi_destroy(&dlmfs_backing_dev_info); } MODULE_AUTHOR("Oracle");