Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 316760 Details for
Bug 462354
dlm: add old plock interface
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
proposed patch
0000-dlm-plock-old-userspace.patch (text/plain), 5.34 KB, created by
David Teigland
on 2008-09-15 16:36:54 UTC
(
hide
)
Description:
proposed patch
Filename:
MIME Type:
Creator:
David Teigland
Created:
2008-09-15 16:36:54 UTC
Size:
5.34 KB
patch
obsolete
>Index: kernel-quilt/fs/dlm/dlm_internal.h >=================================================================== >--- kernel-quilt.orig/fs/dlm/dlm_internal.h >+++ kernel-quilt/fs/dlm/dlm_internal.h >@@ -433,6 +433,7 @@ struct dlm_ls { > struct list_head ls_list; /* list of lockspaces */ > dlm_lockspace_t *ls_local_handle; > uint32_t ls_global_id; /* global unique lockspace ID */ >+ uint32_t ls_fsid; > uint32_t ls_exflags; > int ls_lvblen; > int ls_count; /* reference count */ >Index: kernel-quilt/fs/dlm/lockspace.c >=================================================================== >--- kernel-quilt.orig/fs/dlm/lockspace.c >+++ kernel-quilt/fs/dlm/lockspace.c >@@ -346,6 +346,20 @@ void dlm_put_lockspace(struct dlm_ls *ls > spin_unlock(&lslist_lock); > } > >+void dlm_global_to_fsid(uint32_t global_id, uint32_t *fsid) >+{ >+ struct dlm_ls *ls; >+ >+ spin_lock(&lslist_lock); >+ list_for_each_entry(ls, &lslist, ls_list) { >+ if (ls->ls_global_id == global_id) { >+ *fsid = ls->ls_fsid; >+ break; >+ } >+ } >+ spin_unlock(&lslist_lock); >+} >+ > static void remove_lockspace(struct dlm_ls *ls) > { > for (;;) { >Index: kernel-quilt/fs/dlm/lockspace.h >=================================================================== >--- kernel-quilt.orig/fs/dlm/lockspace.h >+++ kernel-quilt/fs/dlm/lockspace.h >@@ -20,6 +20,7 @@ struct dlm_ls *dlm_find_lockspace_global > struct dlm_ls *dlm_find_lockspace_local(void *id); > struct dlm_ls *dlm_find_lockspace_device(int minor); > void dlm_put_lockspace(struct dlm_ls *ls); >+void dlm_global_to_fsid(uint32_t global_id, uint32_t *fsid); > > #endif /* __LOCKSPACE_DOT_H__ */ > >Index: kernel-quilt/fs/dlm/plock.c >=================================================================== >--- kernel-quilt.orig/fs/dlm/plock.c >+++ kernel-quilt/fs/dlm/plock.c >@@ -321,6 +321,37 @@ out: > } > EXPORT_SYMBOL_GPL(dlm_posix_get); > >+int dlm_posix_set_fsid(dlm_lockspace_t *lockspace, u32 id) >+{ >+ struct dlm_ls *ls; >+ >+ ls = dlm_find_lockspace_local(lockspace); >+ if (!ls) >+ return -EINVAL; >+ >+ ls->ls_fsid = id; >+ >+ dlm_put_lockspace(ls); >+ return 0; >+} >+EXPORT_SYMBOL_GPL(dlm_posix_set_fsid); >+ >+static void munge_fsid(struct file *file, struct plock_op *op) >+{ >+ u32 id = 0; >+ >+ /* op was read through new device */ >+ if (!file->private_data) >+ return; >+ >+ /* op was read through old device, so we need to change the fsid >+ in the op into what the fs has set */ >+ >+ dlm_global_to_fsid(op->info.fsid, &id); >+ if (id) >+ op->info.fsid = id; >+} >+ > /* a read copies out one plock request from the send list */ > static ssize_t dev_read(struct file *file, char __user *u, size_t count, > loff_t *ppos) >@@ -334,6 +365,7 @@ static ssize_t dev_read(struct file *fil > spin_lock(&ops_lock); > if (!list_empty(&send_list)) { > op = list_entry(send_list.next, struct plock_op, list); >+ munge_fsid(file, op); > list_move(&op->list, &recv_list); > memcpy(&info, &op->info, sizeof(info)); > } >@@ -404,7 +436,43 @@ static unsigned int dev_poll(struct file > return 0; > } > >+static int dev_open(struct inode *inode, struct file *file) >+{ >+ file->private_data = NULL; >+ return 0; >+} >+ >+static struct file_operations old_dev_fops; >+ >+static int old_dev_open(struct inode *inode, struct file *file) >+{ >+ file->private_data = &old_dev_fops; >+ return 0; >+} >+ >+static int old_dev_release(struct inode *inode, struct file *file) >+{ >+ file->private_data = NULL; >+ return 0; >+} >+ >+static struct file_operations old_dev_fops = { >+ .open = old_dev_open, >+ .release = old_dev_release, >+ .read = dev_read, >+ .write = dev_write, >+ .poll = dev_poll, >+ .owner = THIS_MODULE >+}; >+ >+static struct miscdevice old_plock_dev_misc = { >+ .minor = MISC_DYNAMIC_MINOR, >+ .name = "lock_dlm_plock", >+ .fops = &old_dev_fops >+}; >+ > static struct file_operations dev_fops = { >+ .open = dev_open, > .read = dev_read, > .write = dev_write, > .poll = dev_poll, >@@ -428,8 +496,17 @@ int dlm_plock_init(void) > init_waitqueue_head(&recv_wq); > > rv = misc_register(&plock_dev_misc); >- if (rv) >+ if (rv) { > log_print("dlm_plock_init: misc_register failed %d", rv); >+ goto out; >+ } >+ >+ rv = misc_register(&old_plock_dev_misc); >+ if (rv) { >+ misc_deregister(&plock_dev_misc); >+ log_print("dlm_plock_init: old misc_register failed %d", rv); >+ } >+ out: > return rv; > } > >@@ -437,5 +514,7 @@ void dlm_plock_exit(void) > { > if (misc_deregister(&plock_dev_misc) < 0) > log_print("dlm_plock_exit: misc_deregister failed"); >+ if (misc_deregister(&old_plock_dev_misc) < 0) >+ log_print("dlm_plock_exit: old misc_deregister failed"); > } > >Index: kernel-quilt/fs/gfs2/locking/dlm/mount.c >=================================================================== >--- kernel-quilt.orig/fs/gfs2/locking/dlm/mount.c >+++ kernel-quilt/fs/gfs2/locking/dlm/mount.c >@@ -154,6 +154,8 @@ static int gdlm_mount(char *table_name, > goto out_kobj; > } > >+ dlm_posix_set_fsid(ls->dlm_lockspace, ls->id); >+ > lockstruct->ls_jid = ls->jid; > lockstruct->ls_first = ls->first; > lockstruct->ls_lockspace = ls; >Index: kernel-quilt/include/linux/dlm_plock.h >=================================================================== >--- kernel-quilt.orig/include/linux/dlm_plock.h >+++ kernel-quilt/include/linux/dlm_plock.h >@@ -44,6 +44,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lo > struct file_lock *fl); > int dlm_posix_get(dlm_lockspace_t *lockspace, u64 number, struct file *file, > struct file_lock *fl); >+int dlm_posix_set_fsid(dlm_lockspace_t *lockspace, u32 id); > #endif /* __KERNEL__ */ > > #endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 462354
: 316760