staging:lustre: get rid of IOC_LIBCFS_MEMHOG and IOC_LIBCFS_PANIC ioctls
cover staging:lustre: get rid of IOC_LIBCFS_MEMHOG and IOC_LIBCFS_PANIC ioctls
Removing unused IOC_LIBCFS_MEMHOG and IOC_LIBCFS_PANIC ioctls from the libcfs/ lnet/ code. This cleanup allows us to remove the cfs_psdev abstraction.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Parinay Kondekar (7):
staging:lustre: remove obsolete comment in libcfs_ioctl.h staging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl staging:lustre: remove struct libcfs_device_userstate staging:lustre: simplify libcfs_psdev_[open|release] staging:lustre: call libcfs_ioctl directly staging:lustre: remove libcfs pseudo device abstraction
.../staging/lustre/include/linux/libcfs/libcfs.h | 23 +--- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 5 +- .../lustre/include/linux/libcfs/libcfs_private.h | 5 - .../staging/lustre/include/linux/lnet/lnetctl.h | 2 - .../lustre/lustre/libcfs/linux/linux-module.c | 54 +----- drivers/staging/lustre/lustre/libcfs/module.c | 175 +------------------- 6 files changed, 19 insertions(+), 245 deletions(-)
PATCH 1/7 staging:lustre: remove obsolete comment in libcfs_ioctl.h
From: Parinay Kondekar <[email protected]>
The libcfs_ioctl.h header has a comment about a snapshot ioctl which has been removed for years. Lets remove the comment to avoid confusion. Broken out of patch 17492.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +0 -1
@@ -102,7 +102,6 @@ struct libcfs_ioctl_handler {/* FIXME check conflict with lustre_lib.h */ #define LIBCFS_IOC_DEBUG_MASK _IOWR('f', 250, long) -/* ioctls for manipulating snapshots 30- */ #define IOC_LIBCFS_TYPE 'e'#define IOC_LIBCFS_MIN_NR 30/* libcfs ioctls */
Signature · 1 line
1.7.1
Greg Kroah-Hartman
maintainerRe: [PATCH 1/7] staging:lustre: remove obsolete comment in libcfs_ioctl.h
Quoted 10 lines · James Simmons
From: Parinay Kondekar <[email protected]>
The
libcfs_ioctl.hheader has a comment about a snapshot ioctl which has been removed for years. Lets remove the comment to avoid confusion. Broken out of patch 17492.Signed-off-by Parinay Kondekar <[email protected]>Signed-off-by James Simmons <[email protected]>Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
Quoted 7 lines
Reviewed-by Andreas Dilger <[email protected]>Reviewed-by Dmitry Eremin <[email protected]>Reviewed-by John L. Hammond <[email protected]>Reviewed-by Oleg Drokin <[email protected]>--- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
Only this patch applied in this series, please rebase the rest of them (fixing up the one I pointed out) and resend.
thanks,
greg k-h
PATCH 2/7 staging:lustre: remove last bits of the IOC_LIBCFS_PANIC ioctl
In reply to James SimmonsFrom: Parinay Kondekar <[email protected]>
A few pieces still exist for the IOC_LIBCFS_PANIC ioctl. Remove these last bits to prevent old tools from using them. The latest lustre utilities no longer use this ioctl.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 2 +- .../staging/lustre/include/linux/lnet/lnetctl.h | 1 - .../lustre/lustre/libcfs/linux/linux-module.c | 5 ----- drivers/staging/lustre/lustre/libcfs/module.c | 5 +---- 4 files changed, 2 insertions(+), 11 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +1 -1
@@ -105,7 +105,7 @@ struct libcfs_ioctl_handler {#define IOC_LIBCFS_TYPE 'e'#define IOC_LIBCFS_MIN_NR 30/* libcfs ioctls */ -#define IOC_LIBCFS_PANIC _IOWR('e', 30, long) +/* IOC_LIBCFS_PANIC obsolete in 2.8.0, was _IOWR('e', 30, IOCTL_LIBCFS_TYPE) */ #define IOC_LIBCFS_CLEAR_DEBUG _IOWR('e', 31, long)#define IOC_LIBCFS_MARK_DEBUG _IOWR('e', 32, long)#define IOC_LIBCFS_MEMHOG _IOWR('e', 36, long)
drivers/staging/lustre/include/linux/lnet/lnetctl.h +0 -1
@@ -74,6 +74,5 @@ int jt_dbg_debug_file(int argc, char **argv);int jt_dbg_clear_debug_buf (int argc,char **argv);int jt_dbg_mark_debug_buf (int argc,char **argv);int jt_dbg_modules (int argc,char **argv); -int jt_dbg_panic (int argc,char **argv);#endif
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +0 -5
@@ -147,11 +147,6 @@ static long libcfs_ioctl(struct file *file,/* Handle platform-dependent IOC requests */ switch (cmd) { -case IOC_LIBCFS_PANIC : -if (!capable (CFS_CAP_SYS_BOOT )) -return -EPERM ; -panic ("debugctl-invoked panic" ); -return 0 ;case IOC_LIBCFS_MEMHOG :if (!capable (CFS_CAP_SYS_ADMIN ))return -EPERM ;
drivers/staging/lustre/lustre/libcfs/module.c +1 -4
@@ -250,10 +250,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,case IOC_LIBCFS_CLEAR_DEBUG :libcfs_debug_clear_buffer ();return 0 ; -/* -* case IOC_LIBCFS_PANIC: -* Handled in arch/cfs_module.c -*/ +case IOC_LIBCFS_MARK_DEBUG :if (data->ioc_inlbuf1 ==NULL || data->ioc_inlbuf1[data->ioc_inllen1 -1 ] !='\0' )
Signature · 1 line
1.7.1
PATCH 3/7 staging:lustre: remove the IOC_LIBCFS_MEMHOG ioctl
In reply to James SimmonsFrom: Parinay Kondekar <[email protected]>
The IOC_LIBCFS_MEMHOG is not needed so remove it.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../lustre/include/linux/libcfs/libcfs_ioctl.h | 2 +- .../staging/lustre/include/linux/lnet/lnetctl.h | 1 - .../lustre/lustre/libcfs/linux/linux-module.c | 8 -- drivers/staging/lustre/lustre/libcfs/module.c | 125 +------------------- 4 files changed, 2 insertions(+), 134 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h +1 -1
@@ -108,7 +108,7 @@ struct libcfs_ioctl_handler {/* IOC_LIBCFS_PANIC obsolete in 2.8.0, was _IOWR('e', 30, IOCTL_LIBCFS_TYPE) */ #define IOC_LIBCFS_CLEAR_DEBUG _IOWR('e', 31, long)#define IOC_LIBCFS_MARK_DEBUG _IOWR('e', 32, long) -#define IOC_LIBCFS_MEMHOG _IOWR('e', 36, long) +/* IOC_LIBCFS_MEMHOG obsolete in 2.8.0, was _IOWR('e', 36, IOCTL_LIBCFS_TYPE) */ /* lnet ioctls */ #define IOC_LIBCFS_GET_NI _IOWR('e', 50, long)#define IOC_LIBCFS_FAIL_NID _IOWR('e', 51, long)
drivers/staging/lustre/include/linux/lnet/lnetctl.h +0 -1
@@ -62,7 +62,6 @@ int jt_ptl_print_routes(int argc, char **argv);int jt_ptl_fail_nid (int argc,char **argv);int jt_ptl_lwt (int argc,char **argv);int jt_ptl_testprotocompat (int argc,char **argv); -int jt_ptl_memhog (int argc,char **argv);int dbg_initialize (int argc,char **argv);int jt_dbg_filter (int argc,char **argv);
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +0 -8
@@ -145,14 +145,6 @@ static long libcfs_ioctl(struct file *file,return -EINVAL ; } -/* Handle platform-dependent IOC requests */ -switch (cmd) { -case IOC_LIBCFS_MEMHOG : -if (!capable (CFS_CAP_SYS_ADMIN )) -return -EPERM ; -/* go thought */ - } - pfile.off =0 ; pfile.private_data = file->private_data;if (libcfs_psdev_ops.p_ioctl !=NULL )
drivers/staging/lustre/lustre/libcfs/module.c +1 -124
144 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 4/7 staging:lustre: remove struct libcfs_device_userstate
In reply to James SimmonsFrom: Parinay Kondekar <[email protected]>
With the removal of the IOC_LIBCFS_MEMHOG ioctl we no longer need struct libcfs_device_userstate.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../lustre/include/linux/libcfs/libcfs_private.h | 5 ----- .../lustre/lustre/libcfs/linux/linux-module.c | 8 ++------ drivers/staging/lustre/lustre/libcfs/module.c | 16 ---------------- 3 files changed, 2 insertions(+), 27 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +0 -5
@@ -391,11 +391,6 @@ int cfs_percpt_atomic_summary(atomic_t **refs);* Support for temporary event tracing with minimal Heisenberg effect. * -------------------------------------------------------------------- */ -struct libcfs_device_userstate { -int ldu_memhog_pages; -struct page *ldu_memhog_root_page; -}; -#define MKSTR (ptr) ((ptr)) ? (ptr) : ""static inline int cfs_size_round4 (int val)
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +2 -6
@@ -98,14 +98,12 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)static int libcfs_psdev_open (struct inode *inode,struct file *file) { -struct libcfs_device_userstate **pdu =NULL ;int rc =0 ;if (!inode)return -EINVAL ; - pdu = (struct libcfs_device_userstate **)&file->private_data;if (libcfs_psdev_ops.p_open !=NULL ) - rc = libcfs_psdev_ops.p_open (0 , (void *)pdu); + rc = libcfs_psdev_ops.p_open (0 ,NULL );else return -EPERM ;return rc;
@@ -115,14 +113,12 @@ libcfs_psdev_open(struct inode *inode, struct file *file)static int libcfs_psdev_release (struct inode *inode,struct file *file) { -struct libcfs_device_userstate *pdu;int rc =0 ;if (!inode)return -EINVAL ; - pdu = file->private_data;if (libcfs_psdev_ops.p_close !=NULL ) - rc = libcfs_psdev_ops.p_close (0 , (void *)pdu); + rc = libcfs_psdev_ops.p_close (0 ,NULL );else rc = -EPERM ;return rc;
drivers/staging/lustre/lustre/libcfs/module.c +0 -16
@@ -71,29 +71,13 @@ static struct dentry *lnet_debugfs_root;/* called when opening /dev/device */ static int libcfs_psdev_open (unsigned long flags,void *args) { -struct libcfs_device_userstate *ldu; -try_module_get (THIS_MODULE ); - -LIBCFS_ALLOC (ldu,sizeof (*ldu)); -if (ldu !=NULL ) { - ldu->ldu_memhog_pages =0 ; - ldu->ldu_memhog_root_page =NULL ; - } - *(struct libcfs_device_userstate **)args = ldu; -return 0 ; }/* called when closing /dev/device */ static int libcfs_psdev_release (unsigned long flags,void *args) { -struct libcfs_device_userstate *ldu; - - ldu = (struct libcfs_device_userstate *)args; -if (ldu !=NULL ) -LIBCFS_FREE (ldu,sizeof (*ldu)); -module_put (THIS_MODULE );return 0 ; }
Signature · 1 line
1.7.1
PATCH 5/7 staging:lustre: simplify libcfs_psdev_[open|release]
In reply to James SimmonsFrom: Parinay Kondekar <[email protected]>
With struct libcfs_device_userstate gone we can move the remaining code of libcfs_psdev_ops.p_[open|close] into the libcfs_psdev_[open|release] functions directly.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../staging/lustre/include/linux/libcfs/libcfs.h | 2 -- .../lustre/lustre/libcfs/linux/linux-module.c | 20 ++++++-------------- drivers/staging/lustre/lustre/libcfs/module.c | 16 ---------------- 3 files changed, 6 insertions(+), 32 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs.h +0 -2
@@ -73,8 +73,6 @@ struct cfs_psdev_file { };struct cfs_psdev_ops { -int (*p_open)(unsigned long ,void *); -int (*p_close)(unsigned long ,void *);int (*p_read)(struct cfs_psdev_file *,char *,unsigned long );int (*p_write)(struct cfs_psdev_file *,char *,unsigned long );int (*p_ioctl)(struct cfs_psdev_file *,unsigned long ,void *);
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +6 -14
@@ -98,30 +98,22 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)static int libcfs_psdev_open (struct inode *inode,struct file *file) { -int rc =0 ; -if (!inode)return -EINVAL ; -if (libcfs_psdev_ops.p_open !=NULL ) - rc = libcfs_psdev_ops.p_open (0 ,NULL ); -else -return -EPERM ; -return rc; + +try_module_get (THIS_MODULE ); +return 0 ; }/* called when closing /dev/device */ static int libcfs_psdev_release (struct inode *inode,struct file *file) { -int rc =0 ; -if (!inode)return -EINVAL ; -if (libcfs_psdev_ops.p_close !=NULL ) - rc = libcfs_psdev_ops.p_close (0 ,NULL ); -else - rc = -EPERM ; -return rc; + +module_put (THIS_MODULE ); +return 0 ; } static long libcfs_ioctl(struct file *file,
drivers/staging/lustre/lustre/libcfs/module.c +0 -16
@@ -68,20 +68,6 @@ MODULE_LICENSE("GPL");static struct dentry *lnet_debugfs_root; -/* called when opening /dev/device */ -static int libcfs_psdev_open (unsigned long flags,void *args) -{ -try_module_get (THIS_MODULE ); -return 0 ; -} - -/* called when closing /dev/device */ -static int libcfs_psdev_release (unsigned long flags,void *args) -{ -module_put (THIS_MODULE ); -return 0 ; -} -static DECLARE_RWSEM (ioctl_list_sem);static LIST_HEAD (ioctl_list);
@@ -180,8 +166,6 @@ out: }struct cfs_psdev_ops libcfs_psdev_ops = { - libcfs_psdev_open, - libcfs_psdev_release,NULL ,NULL , libcfs_ioctl
Signature · 1 line
1.7.1
Greg Kroah-Hartman
maintainerRe: [PATCH 5/7] staging:lustre: simplify libcfs_psdev_[open|release]
Quoted 42 lines · James Simmons
From: Parinay Kondekar <[email protected]>
With struct
libcfs_device_userstategone we can move the remaining code of libcfs_psdev_ops.p_[open|close] into the libcfs_psdev_[open|release] functions directly.Signed-off-by Parinay Kondekar <[email protected]>Signed-off-by James Simmons <[email protected]>Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492Reviewed-by Andreas Dilger <[email protected]>Reviewed-by Dmitry Eremin <[email protected]>Reviewed-by John L. Hammond <[email protected]>Reviewed-by Oleg Drokin <[email protected]>--- .../staging/lustre/include/linux/libcfs/libcfs.h | 2 -- .../lustre/lustre/libcfs/linux/linux-module.c | 20 ++++++-------------- drivers/staging/lustre/lustre/libcfs/module.c | 16 ---------------- 3 files changed, 6 insertions(+), 32 deletions(-)drivers/staging/lustre/include/linux/libcfs/libcfs.h +0
-2@@ -73,8 +73,6 @@ struct cfs_psdev_file { };struct cfs_psdev_ops { -int (*p_open)(unsigned long ,void *); -int (*p_close)(unsigned long ,void *);int (*p_read)(struct cfs_psdev_file *,char *,unsigned long );int (*p_write)(struct cfs_psdev_file *,char *,unsigned long );int (*p_ioctl)(struct cfs_psdev_file *,unsigned long ,void *);drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +0
-1@@ -98,30 +98,22 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)static int libcfs_psdev_open (struct inode *inode,struct file *file) { -int rc =0 ;
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c int libcfs_ioctl_popdata(void *arg, void *data, int size) · line 104
Quoted 10 lines
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +2
-6-if (!inode)return -EINVAL ; -if (libcfs_psdev_ops.p_open !=NULL ) - rc = libcfs_psdev_ops.p_open (0 ,NULL ); -else -return -EPERM ; -return rc; + +try_module_get (THIS_MODULE );
Note, code like this is racy and incorrect and never needed, please fix this up properly (hint, set the module in the file operations.)
Again, if you ever see code with that line, it is incorrect.
thanks,
greg k-h
RE: [lustre-devel] [PATCH 5/7] staging:lustre: simplify libcfs_psdev_[open|release]
Quoted 23 lines
Quoted 9 lines
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +0
-1@@ -98,30 +98,22 @@ int libcfs_ioctl_popdata(void *arg, void *data, int size)static int libcfs_psdev_open (struct inode *inode,struct file *file) { -int rc =0 ;drivers/staging/lustre/lustre/libcfs/linux/linux-module.c int libcfs_ioctl_popdata(void *arg, void *data, int size) · line 104
Quoted 10 lines
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +2
-6-if (!inode)return -EINVAL ; -if (libcfs_psdev_ops.p_open !=NULL ) - rc = libcfs_psdev_ops.p_open (0 ,NULL ); -else -return -EPERM ; -return rc; + +try_module_get (THIS_MODULE );Note, code like this is racy and incorrect and never needed, please fix this up properly (hint, set the module in the file operations.)
Quoted 1 line
Again, if you ever see code with that line, it is incorrect.
So simple
static struct file_operations libcfs_fops = {
.module = THIS_MODULE,
.unlocked_ioctl = libcfs_psdev_ioctl,
};
With the open and release deleted should do the trick then.
PATCH 6/7 staging:lustre: call libcfs_ioctl directly
In reply to James SimmonsFrom: Parinay Kondekar <[email protected]>
No reason to go through the cfs_psdev_ops abstract to call libcfs_ioctl. Just call libcfs_ioctl directly.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../staging/lustre/include/linux/libcfs/libcfs.h | 2 +- .../lustre/lustre/libcfs/linux/linux-module.c | 13 ++++--------- drivers/staging/lustre/lustre/libcfs/module.c | 4 ++-- 3 files changed, 7 insertions(+), 12 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs.h +1 -1
@@ -75,8 +75,8 @@ struct cfs_psdev_file {struct cfs_psdev_ops {int (*p_read)(struct cfs_psdev_file *,char *,unsigned long );int (*p_write)(struct cfs_psdev_file *,char *,unsigned long ); -int (*p_ioctl)(struct cfs_psdev_file *,unsigned long ,void *); }; +int libcfs_ioctl (struct cfs_psdev_file *pfile,unsigned long cmd,void *arg);/* * Drop into debugger, if possible. Implementation is provided by platform.
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +4 -9
@@ -116,11 +116,10 @@ libcfs_psdev_release(struct inode *inode, struct file *file)return 0 ; } -static long libcfs_ioctl (struct file *file, -unsigned int cmd,unsigned long arg) +static long +libcfs_psdev_ioctl (struct file *file,unsigned int cmd,unsigned long arg) {struct cfs_psdev_file pfile; -int rc =0 ;if (!capable (CAP_SYS_ADMIN ))return -EACCES ;
@@ -135,15 +134,11 @@ static long libcfs_ioctl(struct file *file, pfile.off =0 ; pfile.private_data = file->private_data; -if (libcfs_psdev_ops.p_ioctl !=NULL ) - rc = libcfs_psdev_ops.p_ioctl (&pfile, cmd, (void *)arg); -else - rc = -EPERM ; -return rc; +return libcfs_ioctl (&pfile, cmd, (void __user *)arg); }static const struct file_operations libcfs_fops = { - .unlocked_ioctl = libcfs_ioctl, + .unlocked_ioctl = libcfs_psdev_ioctl, .open = libcfs_psdev_open, .release = libcfs_psdev_release, };
drivers/staging/lustre/lustre/libcfs/module.c +2 -2
@@ -140,7 +140,8 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd,return err; } -static int libcfs_ioctl (struct cfs_psdev_file *pfile,unsigned long cmd,void *arg) +int +libcfs_ioctl (struct cfs_psdev_file *pfile,unsigned long cmd,void *arg) {char *buf;struct libcfs_ioctl_data *data;
@@ -168,7 +169,6 @@ out:struct cfs_psdev_ops libcfs_psdev_ops = {NULL ,NULL , - libcfs_ioctl }; static int proc_call_handler(void *data, int write, loff_t *ppos,
Signature · 1 line
1.7.1
PATCH 7/7 staging:lustre: remove libcfs pseudo device abstraction
In reply to James SimmonsFrom: Parinay Kondekar <[email protected]>
With the libcfs ioctl cleanup we no longer need the libcfs pseudo device abstraction.
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5844
Reviewed-on: http://review.whamcloud.com/17492
--- .../staging/lustre/include/linux/libcfs/libcfs.h | 21 +------------------- .../lustre/lustre/libcfs/linux/linux-module.c | 6 +---- drivers/staging/lustre/lustre/libcfs/module.c | 13 +++-------- 3 files changed, 6 insertions(+), 34 deletions(-)
drivers/staging/lustre/include/linux/libcfs/libcfs.h +1 -20
@@ -59,24 +59,7 @@#define LNET_ACCEPTOR_MIN_RESERVED_PORT 512#define LNET_ACCEPTOR_MAX_RESERVED_PORT 1023 -/* -* libcfs pseudo device operations -* -* It's just draft now. -*/ - -struct cfs_psdev_file { -unsigned long off; -void *private_data; -unsigned long reserved1; -unsigned long reserved2; -}; - -struct cfs_psdev_ops { -int (*p_read)(struct cfs_psdev_file *,char *,unsigned long ); -int (*p_write)(struct cfs_psdev_file *,char *,unsigned long ); -}; -int libcfs_ioctl (struct cfs_psdev_file *pfile,unsigned long cmd,void *arg); +int libcfs_ioctl (unsigned long cmd,void *arg);/* * Drop into debugger, if possible. Implementation is provided by platform.
@@ -143,8 +126,6 @@ extern struct miscdevice libcfs_dev;extern char lnet_upcall[1024 ];extern char lnet_debug_log_upcall[1024 ]; -extern struct cfs_psdev_ops libcfs_psdev_ops; -extern struct cfs_wi_sched *cfs_sched_rehash;struct lnet_debugfs_symlink_def {
drivers/staging/lustre/lustre/libcfs/linux/linux-module.c +1 -5
@@ -119,8 +119,6 @@ libcfs_psdev_release(struct inode *inode, struct file *file)static long libcfs_psdev_ioctl (struct file *file,unsigned int cmd,unsigned long arg) { -struct cfs_psdev_file pfile; -if (!capable (CAP_SYS_ADMIN ))return -EACCES ;
@@ -132,9 +130,7 @@ libcfs_psdev_ioctl(struct file *file, unsigned int cmd, unsigned long arg)return -EINVAL ; } - pfile.off =0 ; - pfile.private_data = file->private_data; -return libcfs_ioctl (&pfile, cmd, (void __user *)arg); +return libcfs_ioctl (cmd, (void __user *)arg); }static const struct file_operations libcfs_fops = {
drivers/staging/lustre/lustre/libcfs/module.c +4 -9
@@ -101,8 +101,8 @@ int libcfs_deregister_ioctl(struct libcfs_ioctl_handler *hand) }EXPORT_SYMBOL (libcfs_deregister_ioctl); -static int libcfs_ioctl_int (struct cfs_psdev_file *pfile,unsigned long cmd, -void *arg,struct libcfs_ioctl_data *data) +static int +libcfs_ioctl_int (unsigned long cmd,void *arg,struct libcfs_ioctl_data *data) {int err = -EINVAL ;
@@ -141,7 +141,7 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, unsigned long cmd, }int -libcfs_ioctl (struct cfs_psdev_file *pfile,unsigned long cmd,void *arg) +libcfs_ioctl (unsigned long cmd,void *arg) {char *buf;struct libcfs_ioctl_data *data;
@@ -159,18 +159,13 @@ libcfs_ioctl(struct cfs_psdev_file *pfile, unsigned long cmd, void *arg) } data = (struct libcfs_ioctl_data *)buf; - err =libcfs_ioctl_int (pfile, cmd, arg, data); + err =libcfs_ioctl_int (cmd, arg, data); out:LIBCFS_FREE (buf,1024 );return err; } -struct cfs_psdev_ops libcfs_psdev_ops = { -NULL , -NULL , -}; - static int proc_call_handler(void *data, int write, loff_t *ppos, void __user *buffer, size_t *lenp, int (*handler)(void *data, int write,
Signature · 1 line
1.7.1