From: Enrico Scholz Date: Mon, 2 Jan 2006 23:48:56 +0000 (+0000) Subject: updated to 2.6.14.3-vs2.01 headers X-Git-Tag: version_0_30_210~46 X-Git-Url: http://git.linux-vserver.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b48d047f314222c07decdf57dfd57f5715ca66f1;p=util-vserver.git updated to 2.6.14.3-vs2.01 headers git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2235 94cd875c-1c1d-0410-91d2-eb244daf1a30 --- diff --git a/util-vserver/kernel/context.h b/util-vserver/kernel/context.h index 2cc8238..ed1145e 100644 --- a/util-vserver/kernel/context.h +++ b/util-vserver/kernel/context.h @@ -36,8 +36,7 @@ #define VXF_STATE_SETUP (1ULL<<32) #define VXF_STATE_INIT (1ULL<<33) -#define VXF_SC_HELPER (1ULL<<36) -#define VXF_REBOOT_KILL (1ULL<<37) +#define VXF_STATE_HELPER (1ULL<<36) #define VXF_FORK_RSS (1ULL<<48) #define VXF_PROLIFIC (1ULL<<49) @@ -51,7 +50,7 @@ /* context caps */ -#define VXC_CAP_MASK 0x00000000 +#define VXC_CAP_MASK 0x00000000 #define VXC_SET_UTSNAME 0x00000001 #define VXC_SET_RLIMIT 0x00000002 @@ -113,11 +112,6 @@ struct vx_info { char vx_name[65]; /* vserver name */ }; -struct vx_info_save { - struct vx_info *vxi; - xid_t xid; -}; - /* status flags */ @@ -150,8 +144,8 @@ struct vx_info_save { extern void claim_vx_info(struct vx_info *, struct task_struct *); extern void release_vx_info(struct vx_info *, struct task_struct *); -extern struct vx_info *lookup_vx_info(int); -extern struct vx_info *lookup_or_create_vx_info(int); +extern struct vx_info *locate_vx_info(int); +extern struct vx_info *locate_or_create_vx_info(int); extern int get_xid_list(int, unsigned int *, int); extern int xid_is_hashed(xid_t); diff --git a/util-vserver/kernel/cvirt_def.h b/util-vserver/kernel/cvirt_def.h index 9fabb31..23aa246 100644 --- a/util-vserver/kernel/cvirt_def.h +++ b/util-vserver/kernel/cvirt_def.h @@ -35,7 +35,7 @@ struct _vx_syslog { /* context sub struct */ struct _vx_cvirt { -// int max_threads; /* maximum allowed threads */ + int max_threads; /* maximum allowed threads */ atomic_t nr_threads; /* number of current threads */ atomic_t nr_running; /* number of running threads */ atomic_t nr_uninterruptible; /* number of uninterruptible threads */ @@ -61,24 +61,6 @@ struct _vx_cvirt { struct _vx_syslog syslog; }; - -#ifdef CONFIG_VSERVER_DEBUG - -static inline void __dump_vx_cvirt(struct _vx_cvirt *cvirt) -{ - printk("\t_vx_cvirt:\n"); - printk("\t threads: %4d, %4d, %4d, %4d\n", - atomic_read(&cvirt->nr_threads), - atomic_read(&cvirt->nr_running), - atomic_read(&cvirt->nr_uninterruptible), - atomic_read(&cvirt->nr_onhold)); - /* add rest here */ - printk("\t total_forks = %d\n", atomic_read(&cvirt->total_forks)); -} - -#endif - - struct _vx_sock_acc { atomic_t count; atomic_t total; @@ -87,29 +69,9 @@ struct _vx_sock_acc { /* context sub struct */ struct _vx_cacct { + unsigned long total_forks; + struct _vx_sock_acc sock[5][3]; }; -#ifdef CONFIG_VSERVER_DEBUG - -static inline void __dump_vx_cacct(struct _vx_cacct *cacct) -{ - int i,j; - - printk("\t_vx_cacct:"); - for (i=0; i<5; i++) { - struct _vx_sock_acc *ptr = cacct->sock[i]; - - printk("\t [%d] =", i); - for (j=0; j<3; j++) { - printk(" [%d] = %8d, %8d", j, - atomic_read(&ptr[j].count), - atomic_read(&ptr[j].total)); - } - printk("\n"); - } -} - -#endif - #endif /* _VX_CVIRT_DEF_H */ diff --git a/util-vserver/kernel/debug.h b/util-vserver/kernel/debug.h index b84cbbb..afdf3d4 100644 --- a/util-vserver/kernel/debug.h +++ b/util-vserver/kernel/debug.h @@ -1,7 +1,7 @@ #ifndef _VX_DEBUG_H #define _VX_DEBUG_H -#ifndef CONFIG_VSERVER +#ifndef CONFIG_VSERVER #warning config options missing #endif @@ -12,6 +12,12 @@ #define VXD_QPOS(v,p) (((uint32_t)(v) >> ((p)*8)) & 0xFF) #define VXD_QUAD(v) VXD_QPOS(v,0), VXD_QPOS(v,1), \ VXD_QPOS(v,2), VXD_QPOS(v,3) +#define VXF_QUAD "%u.%u.%u.%u" + +#define VXD_DEV(d) (d), (d)->bd_inode->i_ino, \ + imajor((d)->bd_inode), iminor((d)->bd_inode) +#define VXF_DEV "%p[%lu,%d:%d]" + #define __FUNC__ __func__ @@ -24,7 +30,6 @@ extern unsigned int vx_debug_nid; extern unsigned int vx_debug_net; extern unsigned int vx_debug_limit; extern unsigned int vx_debug_dlim; -extern unsigned int vx_debug_quota; extern unsigned int vx_debug_cvirt; extern unsigned int vx_debug_misc; @@ -62,10 +67,6 @@ extern unsigned int vx_debug_misc; ({ static char _buffer[PATH_MAX]; \ d_path((d), (m), _buffer, sizeof(_buffer)); }) - -void dump_vx_info(struct vx_info *, int); -void dump_vx_info_inactive(int); - #else /* CONFIG_VSERVER_DEBUG */ #define vx_debug_switch 0 @@ -83,7 +84,6 @@ void dump_vx_info_inactive(int); #define vxd_path "" - #endif /* CONFIG_VSERVER_DEBUG */ @@ -142,9 +142,14 @@ struct _vx_hist_entry { struct _vx_hist_entry *vxh_advance(void *loc); +#define VXH_HERE(__type) \ + ({ __label__ __vxh_##__type; \ + __vxh_##__type:; \ + &&__vxh_##__type; }) + -static inline -void __vxh_copy_vxi(struct _vx_hist_entry *entry, struct vx_info *vxi) + +static inline void __vxh_copy_vxi(struct _vx_hist_entry *entry, struct vx_info *vxi) { entry->vxi.ptr = vxi; if (vxi) { @@ -155,118 +160,95 @@ void __vxh_copy_vxi(struct _vx_hist_entry *entry, struct vx_info *vxi) } -#define __HERE__ \ - ({ __label__ __vxh_label; __vxh_label:; &&__vxh_label; }) - -#define __VXH_BODY(__type, __data, __here) \ +#define __VXH_BODY(__type, __data) \ struct _vx_hist_entry *entry; \ \ preempt_disable(); \ - entry = vxh_advance(__here); \ + entry = vxh_advance(VXH_HERE(__type)); \ __data; \ entry->type = __type; \ preempt_enable(); /* pass vxi only */ - -#define __VXH_SMPL \ +#define __VXH_SIMPLE \ __vxh_copy_vxi(entry, vxi) -static inline -void __vxh_smpl(struct vx_info *vxi, int __type, void *__here) -{ - __VXH_BODY(__type, __VXH_SMPL, __here) +#define VXH_SIMPLE(__name, __type) \ +static inline void __name(struct vx_info *vxi) \ +{ \ + __VXH_BODY(__type, __VXH_SIMPLE) \ } /* pass vxi and data (void *) */ - #define __VXH_DATA \ __vxh_copy_vxi(entry, vxi); \ entry->sc.data = data -static inline -void __vxh_data(struct vx_info *vxi, void *data, - int __type, void *__here) -{ - __VXH_BODY(__type, __VXH_DATA, __here) +#define VXH_DATA(__name, __type) \ +static inline \ +void __name(struct vx_info *vxi, void *data) \ +{ \ + __VXH_BODY(__type, __VXH_DATA) \ } /* pass vxi and arg (long) */ - -#define __VXH_LONG \ +#define __VXH_LARG \ __vxh_copy_vxi(entry, vxi); \ entry->ll.arg = arg -static inline -void __vxh_long(struct vx_info *vxi, long arg, - int __type, void *__here) -{ - __VXH_BODY(__type, __VXH_LONG, __here) +#define VXH_LARG(__name, __type) \ +static inline \ +void __name(struct vx_info *vxi, long arg) \ +{ \ + __VXH_BODY(__type, __VXH_LARG) \ } -static inline -void __vxh_throw_oops(void *__here) +static inline void vxh_throw_oops(void) { - __VXH_BODY(VXH_THROW_OOPS, {}, __here); + __VXH_BODY(VXH_THROW_OOPS, {}); /* prevent further acquisition */ vxh_active = 0; } +VXH_SIMPLE(vxh_get_vx_info, VXH_GET_VX_INFO); +VXH_SIMPLE(vxh_put_vx_info, VXH_PUT_VX_INFO); -#define vxh_throw_oops() __vxh_throw_oops(__HERE__); - -#define __vxh_get_vx_info(v,h) __vxh_smpl(v, VXH_GET_VX_INFO, h); -#define __vxh_put_vx_info(v,h) __vxh_smpl(v, VXH_PUT_VX_INFO, h); - -#define __vxh_init_vx_info(v,d,h) \ - __vxh_data(v,d, VXH_INIT_VX_INFO, h); -#define __vxh_set_vx_info(v,d,h) \ - __vxh_data(v,d, VXH_SET_VX_INFO, h); -#define __vxh_clr_vx_info(v,d,h) \ - __vxh_data(v,d, VXH_CLR_VX_INFO, h); +VXH_DATA(vxh_init_vx_info, VXH_INIT_VX_INFO); +VXH_DATA(vxh_set_vx_info, VXH_SET_VX_INFO); +VXH_DATA(vxh_clr_vx_info, VXH_CLR_VX_INFO); -#define __vxh_claim_vx_info(v,d,h) \ - __vxh_data(v,d, VXH_CLAIM_VX_INFO, h); -#define __vxh_release_vx_info(v,d,h) \ - __vxh_data(v,d, VXH_RELEASE_VX_INFO, h); +VXH_DATA(vxh_claim_vx_info, VXH_CLAIM_VX_INFO); +VXH_DATA(vxh_release_vx_info, VXH_RELEASE_VX_INFO); -#define vxh_alloc_vx_info(v) \ - __vxh_smpl(v, VXH_ALLOC_VX_INFO, __HERE__); -#define vxh_dealloc_vx_info(v) \ - __vxh_smpl(v, VXH_DEALLOC_VX_INFO, __HERE__); +VXH_SIMPLE(vxh_alloc_vx_info, VXH_ALLOC_VX_INFO); +VXH_SIMPLE(vxh_dealloc_vx_info, VXH_DEALLOC_VX_INFO); -#define vxh_hash_vx_info(v) \ - __vxh_smpl(v, VXH_HASH_VX_INFO, __HERE__); -#define vxh_unhash_vx_info(v) \ - __vxh_smpl(v, VXH_UNHASH_VX_INFO, __HERE__); +VXH_SIMPLE(vxh_hash_vx_info, VXH_HASH_VX_INFO); +VXH_SIMPLE(vxh_unhash_vx_info, VXH_UNHASH_VX_INFO); -#define vxh_loc_vx_info(v,l) \ - __vxh_long(v,l, VXH_LOC_VX_INFO, __HERE__); -#define vxh_lookup_vx_info(v,l) \ - __vxh_long(v,l, VXH_LOOKUP_VX_INFO, __HERE__); -#define vxh_create_vx_info(v,l) \ - __vxh_long(v,l, VXH_CREATE_VX_INFO, __HERE__); +VXH_LARG(vxh_loc_vx_info, VXH_LOC_VX_INFO); +VXH_LARG(vxh_lookup_vx_info, VXH_LOOKUP_VX_INFO); +VXH_LARG(vxh_create_vx_info, VXH_CREATE_VX_INFO); extern void vxh_dump_history(void); #else /* CONFIG_VSERVER_HISTORY */ -#define __HERE__ 0 #define vxh_throw_oops() do { } while (0) -#define __vxh_get_vx_info(v,h) do { } while (0) -#define __vxh_put_vx_info(v,h) do { } while (0) +#define vxh_get_vx_info(v) do { } while (0) +#define vxh_put_vx_info(v) do { } while (0) -#define __vxh_init_vx_info(v,d,h) do { } while (0) -#define __vxh_set_vx_info(v,d,h) do { } while (0) -#define __vxh_clr_vx_info(v,d,h) do { } while (0) +#define vxh_init_vx_info(v,d) do { } while (0) +#define vxh_set_vx_info(v,d) do { } while (0) +#define vxh_clr_vx_info(v,d) do { } while (0) -#define __vxh_claim_vx_info(v,d,h) do { } while (0) -#define __vxh_release_vx_info(v,d,h) do { } while (0) +#define vxh_claim_vx_info(v,d) do { } while (0) +#define vxh_release_vx_info(v,d) do { } while (0) #define vxh_alloc_vx_info(v) do { } while (0) #define vxh_dealloc_vx_info(v) do { } while (0) @@ -289,7 +271,7 @@ extern void vxh_dump_history(void); #define vxd_assert(c,f,x...) vxlprintk(!(c), \ "assertion [" f "] failed.", ##x, __FILE__, __LINE__) #else -#define vxd_assert_lock(l) do { } while (0) +#define vxd_assert_lock(l) do { } while (0) #define vxd_assert(c,f,x...) do { } while (0) #endif diff --git a/util-vserver/kernel/global.h b/util-vserver/kernel/global.h deleted file mode 100644 index ad60acb..0000000 --- a/util-vserver/kernel/global.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef _VX_GLOBAL_H -#define _VX_GLOBAL_H - -#ifndef CONFIG_VSERVER -#warning config options missing -#endif - - -extern atomic_t vx_global_ctotal; -extern atomic_t vx_global_cactive; - -#endif /* _VX_GLOBAL_H */ diff --git a/util-vserver/kernel/inode.h b/util-vserver/kernel/inode.h index 89212c2..25859ee 100644 --- a/util-vserver/kernel/inode.h +++ b/util-vserver/kernel/inode.h @@ -15,7 +15,7 @@ #ifdef __KERNEL__ -#ifndef CONFIG_VSERVER +#ifndef CONFIG_VSERVER #warning config options missing #endif diff --git a/util-vserver/kernel/limit.h b/util-vserver/kernel/limit.h index d23f46e..8656fd9 100644 --- a/util-vserver/kernel/limit.h +++ b/util-vserver/kernel/limit.h @@ -16,8 +16,6 @@ void vx_vsi_swapinfo(struct sysinfo *); #define VXD_RLIMIT(r,l) (VXD_CBIT(limit, (l)) && ((r) == (l))) -#define VXD_RLIMIT_COND(r) (VXD_CBIT(limit, (r))) - #define NUM_LIMITS 24 extern const char *vlimit_name[NUM_LIMITS]; diff --git a/util-vserver/kernel/limit_def.h b/util-vserver/kernel/limit_def.h index 0a2e211..bab1def 100644 --- a/util-vserver/kernel/limit_def.h +++ b/util-vserver/kernel/limit_def.h @@ -9,7 +9,7 @@ /* context sub struct */ struct _vx_limit { -// atomic_t ticks; + atomic_t ticks; unsigned long rlim[NUM_LIMITS]; /* Context limit */ unsigned long rmax[NUM_LIMITS]; /* Context maximum */ @@ -17,21 +17,5 @@ struct _vx_limit { atomic_t lhit[NUM_LIMITS]; /* Limit hits */ }; -#ifdef CONFIG_VSERVER_DEBUG - -static inline void __dump_vx_limit(struct _vx_limit *limit) -{ - int i; - - printk("\t_vx_limit:"); - for (i=0; irlim[i], limit->rmax[i], - atomic_read(&limit->rcur[i]), - atomic_read(&limit->lhit[i])); - } -} - -#endif #endif /* _VX_LIMIT_DEF_H */ diff --git a/util-vserver/kernel/network.h b/util-vserver/kernel/network.h index 2771f13..84a005c 100644 --- a/util-vserver/kernel/network.h +++ b/util-vserver/kernel/network.h @@ -15,7 +15,7 @@ #define NXF_STATE_SETUP (1ULL<<32) -#define NXF_SC_HELPER (1ULL<<36) +#define NXF_STATE_HELPER (1ULL<<36) #define NXF_ONE_TIME (0x0001ULL<<32) @@ -24,12 +24,12 @@ /* address types */ -#define NXA_TYPE_IPV4 1 -#define NXA_TYPE_IPV6 2 +#define NXA_TYPE_IPV4 1 +#define NXA_TYPE_IPV6 2 -#define NXA_MOD_BCAST (1<<8) +#define NXA_MOD_BCAST (1<<8) -#define NXA_TYPE_ANY (~0) +#define NXA_TYPE_ANY (~0) #ifdef __KERNEL__ @@ -70,7 +70,8 @@ struct nx_info { #define NXS_SHUTDOWN 0x0100 #define NXS_RELEASED 0x8000 -extern struct nx_info *lookup_nx_info(int); +extern struct nx_info *locate_nx_info(int); +extern struct nx_info *locate_or_create_nx_info(int); extern int get_nid_list(int, unsigned int *, int); extern int nid_is_hashed(nid_t); diff --git a/util-vserver/kernel/sched_def.h b/util-vserver/kernel/sched_def.h index e8e13f9..3a57761 100644 --- a/util-vserver/kernel/sched_def.h +++ b/util-vserver/kernel/sched_def.h @@ -35,20 +35,4 @@ struct _vx_sched { struct _vx_ticks cpu[NR_CPUS]; }; - -#ifdef CONFIG_VSERVER_DEBUG - -static inline void __dump_vx_sched(struct _vx_sched *sched) -{ - printk("\t_vx_sched:\n"); - printk("\t tokens: %4d, %4d, %4d, %4d, %4d\n", - atomic_read(&sched->tokens), - sched->fill_rate, sched->interval, - sched->tokens_min, sched->tokens_max); - printk("\t priority = %4d, %4d\n", - sched->priority_bias, sched->vavavoom); -} - -#endif - #endif /* _VX_SCHED_DEF_H */ diff --git a/util-vserver/kernel/signal.h b/util-vserver/kernel/signal.h deleted file mode 100644 index b17c18e..0000000 --- a/util-vserver/kernel/signal.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _VX_SIGNAL_H -#define _VX_SIGNAL_H - -#ifdef __KERNEL__ - - -struct vx_info; - -int vx_info_kill(struct vx_info *, int, int); - -#endif /* __KERNEL__ */ -#else /* _VX_SIGNAL_H */ -#warning duplicate inclusion -#endif /* _VX_SIGNAL_H */ diff --git a/util-vserver/kernel/xid.h b/util-vserver/kernel/xid.h index b789e8d..263ed67 100644 --- a/util-vserver/kernel/xid.h +++ b/util-vserver/kernel/xid.h @@ -1,7 +1,7 @@ #ifndef _VX_XID_H #define _VX_XID_H -#ifndef CONFIG_VSERVER +#ifndef CONFIG_VSERVER #warning config options missing #endif @@ -9,9 +9,9 @@ #ifdef CONFIG_XID_TAG_NFSD -#define XID_TAG_NFSD 1 +#define XID_TAG_NFSD 1 #else -#define XID_TAG_NFSD 0 +#define XID_TAG_NFSD 0 #endif @@ -141,16 +141,7 @@ static inline gid_t vx_map_gid(gid_t gid) #define FIOC_SETXIDJ _IOW('x', 3, long) #endif -#ifdef CONFIG_XID_PROPAGATE - int vx_parse_xid(char *string, xid_t *xid, int remove); - -void __vx_propagate_xid(struct nameidata *nd, struct inode *inode); - -#define vx_propagate_xid(n,i) __vx_propagate_xid(n,i) - -#else -#define vx_propagate_xid(n,i) do { } while (0) -#endif +void vx_propagate_xid(struct nameidata *nd, struct inode *inode); #endif /* _VX_XID_H */