mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-23 10:54:35 +03:00
Cleanly split Linux proc.h (fs) from conflicting Solaris proc.h (process)
Under linux the proc.h header is for the /proc filesystem, and under Solaris the proc/h header if for processes. This patch correctly moves the Linux proc functionality in a linux/proc_compat.h header and leaves the sys/proc.h for use by Solaris. Minor updates were required to all the call sites where it was included of course.
This commit is contained in:
+1
-1
@@ -26,10 +26,10 @@
|
||||
#define _SPL_KSTAT_H
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/proc_compat.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/proc.h>
|
||||
|
||||
#define KSTAT_STRLEN 31
|
||||
|
||||
|
||||
@@ -25,33 +25,4 @@
|
||||
#ifndef _SPL_PROC_H
|
||||
#define _SPL_PROC_H
|
||||
|
||||
#include <linux/proc_fs.h>
|
||||
#include <linux/kmod.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <linux/sysctl.h>
|
||||
#include <linux/seq_file.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/systeminfo.h>
|
||||
#include <sys/kmem.h>
|
||||
#include <sys/mutex.h>
|
||||
#include <sys/kstat.h>
|
||||
#include <sys/debug.h>
|
||||
|
||||
#ifdef CONFIG_SYSCTL
|
||||
#ifdef HAVE_2ARGS_REGISTER_SYSCTL
|
||||
#define spl_register_sysctl_table(t, a) register_sysctl_table(t, a)
|
||||
#else
|
||||
#define spl_register_sysctl_table(t, a) register_sysctl_table(t)
|
||||
#endif /* HAVE_2ARGS_REGISTER_SYSCTL */
|
||||
#define spl_unregister_sysctl_table(t) unregister_sysctl_table(t)
|
||||
#endif /* CONFIG_SYSCTL */
|
||||
|
||||
extern struct proc_dir_entry *proc_spl_kstat;
|
||||
struct proc_dir_entry *proc_dir_entry_find(struct proc_dir_entry *root,
|
||||
const char *str);
|
||||
int proc_dir_entries(struct proc_dir_entry *root);
|
||||
|
||||
int proc_init(void);
|
||||
void proc_fini(void);
|
||||
|
||||
#endif /* SPL_PROC_H */
|
||||
|
||||
@@ -64,11 +64,12 @@
|
||||
#define DEV_BSIZE 512
|
||||
#define DEV_BSHIFT 9 /* log2(DEV_BSIZE) */
|
||||
|
||||
#define curproc current
|
||||
#define proc_pageout NULL
|
||||
#define max_ncpus 64
|
||||
#define curproc get_current()
|
||||
#define max_ncpus 64
|
||||
#define CPU_SEQID smp_processor_id() /* I think... */
|
||||
#define _NOTE(x)
|
||||
#define is_system_labeled() 0
|
||||
|
||||
|
||||
#define RLIM64_INFINITY RLIM_INFINITY
|
||||
@@ -131,7 +132,6 @@
|
||||
extern char spl_version[16];
|
||||
extern long spl_hostid;
|
||||
extern char hw_serial[11];
|
||||
extern int p0;
|
||||
|
||||
/* Missing misc functions */
|
||||
extern int highbit(unsigned long i);
|
||||
|
||||
@@ -94,6 +94,10 @@ void spl_taskq_fini(void);
|
||||
#define taskq_wait(tq) __taskq_wait(tq)
|
||||
#define taskq_dispatch(tq, f, p, fl) __taskq_dispatch(tq, f, p, fl)
|
||||
#define taskq_create(n, th, p, mi, ma, fl) __taskq_create(n, th, p, mi, ma, fl)
|
||||
#define taskq_create_proc(n, th, p, mi, ma, pr, fl) \
|
||||
__taskq_create(n, th, p, mi, ma, fl)
|
||||
#define taskq_create_sysdc(n, th, mi, ma, pr, dc, fl) \
|
||||
__taskq_create(n, th, maxclsyspri, mi, ma, fl)
|
||||
#define taskq_destroy(tq) __taskq_destroy(tq)
|
||||
|
||||
#endif /* _SPL_TASKQ_H */
|
||||
|
||||
@@ -41,11 +41,6 @@
|
||||
#define TS_RUN TASK_RUNNING
|
||||
#define TS_ZOMB EXIT_ZOMBIE
|
||||
#define TS_STOPPED TASK_STOPPED
|
||||
#if 0
|
||||
#define TS_FREE 0x00 /* No clean linux mapping */
|
||||
#define TS_ONPROC 0x04 /* No clean linux mapping */
|
||||
#define TS_WAIT 0x20 /* No clean linux mapping */
|
||||
#endif
|
||||
|
||||
typedef void (*thread_func_t)(void *);
|
||||
|
||||
@@ -53,13 +48,13 @@ typedef void (*thread_func_t)(void *);
|
||||
__thread_create(stk, stksize, (thread_func_t)func, \
|
||||
#func, arg, len, pp, state, pri)
|
||||
#define thread_exit() __thread_exit()
|
||||
#define thread_join(t) SBUG()
|
||||
#define curthread get_current()
|
||||
|
||||
extern kthread_t *__thread_create(caddr_t stk, size_t stksize,
|
||||
thread_func_t func, const char *name,
|
||||
void *args, size_t len, int *pp,
|
||||
void *args, size_t len, proc_t *pp,
|
||||
int state, pri_t pri);
|
||||
extern void __thread_exit(void);
|
||||
|
||||
#endif /* _SPL_THREAD_H */
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include <linux/mutex_compat.h>
|
||||
#include <linux/module_compat.h>
|
||||
#include <linux/sysctl_compat.h>
|
||||
#include <linux/proc_compat.h>
|
||||
|
||||
#ifndef HAVE_UINTPTR_T
|
||||
typedef unsigned long uintptr_t;
|
||||
@@ -63,6 +64,7 @@ typedef unsigned long long rlim64_t;
|
||||
typedef long long longlong_t;
|
||||
typedef long long offset_t;
|
||||
typedef struct task_struct kthread_t;
|
||||
typedef struct task_struct proc_t;
|
||||
typedef struct vmem { } vmem_t;
|
||||
typedef short pri_t;
|
||||
typedef struct timespec timestruc_t; /* definition per SVr4 */
|
||||
@@ -79,4 +81,6 @@ typedef ulong_t pgcnt_t;
|
||||
typedef long spgcnt_t;
|
||||
typedef short index_t;
|
||||
|
||||
extern proc_t p0;
|
||||
|
||||
#endif /* _SPL_TYPES_H */
|
||||
|
||||
Reference in New Issue
Block a user