Lines 41-46
Link Here
|
41 |
#include <sys/cdefs.h> |
41 |
#include <sys/cdefs.h> |
42 |
__FBSDID("$FreeBSD$"); |
42 |
__FBSDID("$FreeBSD$"); |
43 |
|
43 |
|
|
|
44 |
#include "opt_compat.h" |
44 |
#include "opt_ddb.h" |
45 |
#include "opt_ddb.h" |
45 |
#include "opt_watchdog.h" |
46 |
#include "opt_watchdog.h" |
46 |
|
47 |
|
Lines 3110-3131
Link Here
|
3110 |
/* |
3111 |
/* |
3111 |
* Fill in a struct xvfsconf based on a struct vfsconf. |
3112 |
* Fill in a struct xvfsconf based on a struct vfsconf. |
3112 |
*/ |
3113 |
*/ |
3113 |
static void |
3114 |
static int |
3114 |
vfsconf2x(struct vfsconf *vfsp, struct xvfsconf *xvfsp) |
3115 |
vfsconf2x(struct sysctl_req *req, struct vfsconf *vfsp) |
3115 |
{ |
3116 |
{ |
|
|
3117 |
struct xvfsconf xvfsp; |
3116 |
|
3118 |
|
3117 |
strcpy(xvfsp->vfc_name, vfsp->vfc_name); |
3119 |
bzero(&xvfsp, sizeof(xvfsp)); |
3118 |
xvfsp->vfc_typenum = vfsp->vfc_typenum; |
3120 |
strcpy(xvfsp.vfc_name, vfsp->vfc_name); |
3119 |
xvfsp->vfc_refcount = vfsp->vfc_refcount; |
3121 |
xvfsp.vfc_typenum = vfsp->vfc_typenum; |
3120 |
xvfsp->vfc_flags = vfsp->vfc_flags; |
3122 |
xvfsp.vfc_refcount = vfsp->vfc_refcount; |
|
|
3123 |
xvfsp.vfc_flags = vfsp->vfc_flags; |
3121 |
/* |
3124 |
/* |
3122 |
* These are unused in userland, we keep them |
3125 |
* These are unused in userland, we keep them |
3123 |
* to not break binary compatibility. |
3126 |
* to not break binary compatibility. |
3124 |
*/ |
3127 |
*/ |
3125 |
xvfsp->vfc_vfsops = NULL; |
3128 |
xvfsp.vfc_vfsops = NULL; |
3126 |
xvfsp->vfc_next = NULL; |
3129 |
xvfsp.vfc_next = NULL; |
|
|
3130 |
return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); |
3127 |
} |
3131 |
} |
3128 |
|
3132 |
|
|
|
3133 |
#ifdef COMPAT_FREEBSD32 |
3134 |
struct xvfsconf32 { |
3135 |
uint32_t vfc_vfsops; |
3136 |
char vfc_name[MFSNAMELEN]; |
3137 |
int32_t vfc_typenum; |
3138 |
int32_t vfc_refcount; |
3139 |
int32_t vfc_flags; |
3140 |
uint32_t vfc_next; |
3141 |
}; |
3142 |
|
3143 |
static int |
3144 |
vfsconf2x32(struct sysctl_req *req, struct vfsconf *vfsp) |
3145 |
{ |
3146 |
struct xvfsconf32 xvfsp; |
3147 |
|
3148 |
strcpy(xvfsp.vfc_name, vfsp->vfc_name); |
3149 |
xvfsp.vfc_typenum = vfsp->vfc_typenum; |
3150 |
xvfsp.vfc_refcount = vfsp->vfc_refcount; |
3151 |
xvfsp.vfc_flags = vfsp->vfc_flags; |
3152 |
xvfsp.vfc_vfsops = 0; |
3153 |
xvfsp.vfc_next = 0; |
3154 |
return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); |
3155 |
} |
3156 |
#endif |
3157 |
|
3129 |
/* |
3158 |
/* |
3130 |
* Top level filesystem related information gathering. |
3159 |
* Top level filesystem related information gathering. |
3131 |
*/ |
3160 |
*/ |
Lines 3133-3146
Link Here
|
3133 |
sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) |
3162 |
sysctl_vfs_conflist(SYSCTL_HANDLER_ARGS) |
3134 |
{ |
3163 |
{ |
3135 |
struct vfsconf *vfsp; |
3164 |
struct vfsconf *vfsp; |
3136 |
struct xvfsconf xvfsp; |
|
|
3137 |
int error; |
3165 |
int error; |
3138 |
|
3166 |
|
3139 |
error = 0; |
3167 |
error = 0; |
3140 |
TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { |
3168 |
TAILQ_FOREACH(vfsp, &vfsconf, vfc_list) { |
3141 |
bzero(&xvfsp, sizeof(xvfsp)); |
3169 |
#ifdef COMPAT_FREEBSD32 |
3142 |
vfsconf2x(vfsp, &xvfsp); |
3170 |
if (req->flags & SCTL_MASK32) |
3143 |
error = SYSCTL_OUT(req, &xvfsp, sizeof xvfsp); |
3171 |
error = vfsconf2x32(req, vfsp); |
|
|
3172 |
else |
3173 |
#endif |
3174 |
error = vfsconf2x(req, vfsp); |
3144 |
if (error) |
3175 |
if (error) |
3145 |
break; |
3176 |
break; |
3146 |
} |
3177 |
} |
Lines 3160-3166
Link Here
|
3160 |
int *name = (int *)arg1 - 1; /* XXX */ |
3191 |
int *name = (int *)arg1 - 1; /* XXX */ |
3161 |
u_int namelen = arg2 + 1; /* XXX */ |
3192 |
u_int namelen = arg2 + 1; /* XXX */ |
3162 |
struct vfsconf *vfsp; |
3193 |
struct vfsconf *vfsp; |
3163 |
struct xvfsconf xvfsp; |
|
|
3164 |
|
3194 |
|
3165 |
printf("WARNING: userland calling deprecated sysctl, " |
3195 |
printf("WARNING: userland calling deprecated sysctl, " |
3166 |
"please rebuild world\n"); |
3196 |
"please rebuild world\n"); |
Lines 3184-3192
Link Here
|
3184 |
break; |
3214 |
break; |
3185 |
if (vfsp == NULL) |
3215 |
if (vfsp == NULL) |
3186 |
return (EOPNOTSUPP); |
3216 |
return (EOPNOTSUPP); |
3187 |
bzero(&xvfsp, sizeof(xvfsp)); |
3217 |
#ifdef COMPAT_FREEBSD32 |
3188 |
vfsconf2x(vfsp, &xvfsp); |
3218 |
if (req->flags & SCTL_MASK32) |
3189 |
return (SYSCTL_OUT(req, &xvfsp, sizeof(xvfsp))); |
3219 |
return (vfsconf2x32(req, vfsp)); |
|
|
3220 |
else |
3221 |
#endif |
3222 |
return (vfsconf2x(req, vfsp)); |
3190 |
} |
3223 |
} |
3191 |
return (EOPNOTSUPP); |
3224 |
return (EOPNOTSUPP); |
3192 |
} |
3225 |
} |