version 1.78.10.3, 2010/03/11 15:04:14 |
version 1.78.10.4, 2010/08/11 22:54:35 |
Line 78 static struct putter_ops puffs_putter = |
|
Line 78 static struct putter_ops puffs_putter = |
|
.pop_close = puffs_msgif_close, |
.pop_close = puffs_msgif_close, |
}; |
}; |
|
|
|
/* |
|
* Try to ensure data structures used by the puffs protocol |
|
* do not unexpectedly change. |
|
*/ |
|
#ifdef __i386__ |
|
CTASSERT(sizeof(struct puffs_kargs) == 3928); |
|
CTASSERT(sizeof(struct vattr) == 136); |
|
CTASSERT(sizeof(struct puffs_req) == 44); |
|
#endif |
|
|
int |
int |
puffs_vfsop_mount(struct mount *mp, const char *path, void *data, |
puffs_vfsop_mount(struct mount *mp, const char *path, void *data, |
size_t *data_len) |
size_t *data_len) |
Line 111 puffs_vfsop_mount(struct mount *mp, cons |
|
Line 121 puffs_vfsop_mount(struct mount *mp, cons |
|
|
|
args = (struct puffs_kargs *)data; |
args = (struct puffs_kargs *)data; |
|
|
/* devel phase */ |
if (args->pa_vers != PUFFSVERSION) { |
if (args->pa_vers != (PUFFSVERSION | PUFFSDEVELVERS)) { |
|
printf("puffs_mount: development version mismatch: " |
printf("puffs_mount: development version mismatch: " |
"kernel %d, lib %d\n", |
"kernel %d, lib %d\n", PUFFSVERSION, args->pa_vers); |
PUFFSVERSION, args->pa_vers & ~PUFFSDEVELVERS); |
|
error = EINVAL; |
error = EINVAL; |
goto out; |
goto out; |
} |
} |
Line 131 puffs_vfsop_mount(struct mount *mp, cons |
|
Line 139 puffs_vfsop_mount(struct mount *mp, cons |
|
goto out; |
goto out; |
} |
} |
|
|
|
for (i = 0; i < __arraycount(args->pa_spare); i++) { |
|
if (args->pa_spare[i] != 0) { |
|
printf("puffs_mount: pa_spare[%d] = 0x%x\n", |
|
i, args->pa_spare[i]); |
|
error = EINVAL; |
|
goto out; |
|
} |
|
} |
|
|
/* use dummy value for passthrough */ |
/* use dummy value for passthrough */ |
if (args->pa_fhflags & PUFFS_FHFLAG_PASSTHROUGH) |
if (args->pa_fhflags & PUFFS_FHFLAG_PASSTHROUGH) |
args->pa_fhsize = sizeof(struct fid); |
args->pa_fhsize = sizeof(struct fid); |
Line 206 puffs_vfsop_mount(struct mount *mp, cons |
|
Line 223 puffs_vfsop_mount(struct mount *mp, cons |
|
if (error) |
if (error) |
goto out; |
goto out; |
mp->mnt_stat.f_iosize = DEV_BSIZE; |
mp->mnt_stat.f_iosize = DEV_BSIZE; |
|
mp->mnt_stat.f_namemax = args->pa_svfsb.f_namemax; |
|
|
/* |
/* |
* We can't handle the VFS_STATVFS() mount_domount() does |
* We can't handle the VFS_STATVFS() mount_domount() does |
Line 275 puffs_vfsop_mount(struct mount *mp, cons |
|
Line 293 puffs_vfsop_mount(struct mount *mp, cons |
|
pmp->pmp_root_vtype = args->pa_root_vtype; |
pmp->pmp_root_vtype = args->pa_root_vtype; |
pmp->pmp_root_vsize = args->pa_root_vsize; |
pmp->pmp_root_vsize = args->pa_root_vsize; |
pmp->pmp_root_rdev = args->pa_root_rdev; |
pmp->pmp_root_rdev = args->pa_root_rdev; |
|
pmp->pmp_docompat = args->pa_time32; |
|
|
mutex_init(&pmp->pmp_lock, MUTEX_DEFAULT, IPL_NONE); |
mutex_init(&pmp->pmp_lock, MUTEX_DEFAULT, IPL_NONE); |
mutex_init(&pmp->pmp_sopmtx, MUTEX_DEFAULT, IPL_NONE); |
mutex_init(&pmp->pmp_sopmtx, MUTEX_DEFAULT, IPL_NONE); |
Line 539 pageflush(struct mount *mp, kauth_cred_t |
|
Line 558 pageflush(struct mount *mp, kauth_cred_t |
|
* vnodes through other routes in any case. So there, |
* vnodes through other routes in any case. So there, |
* sync() doesn't actually sync. Happy now? |
* sync() doesn't actually sync. Happy now? |
*/ |
*/ |
rv = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK); |
rv = vget(vp, LK_EXCLUSIVE | LK_NOWAIT); |
if (rv) { |
if (rv) { |
mutex_enter(&mntvnode_lock); |
mutex_enter(&mntvnode_lock); |
if (rv == ENOENT) { |
if (rv == ENOENT) { |
Line 758 puffs_vfsop_snapshot(struct mount *mp, s |
|
Line 777 puffs_vfsop_snapshot(struct mount *mp, s |
|
return EOPNOTSUPP; |
return EOPNOTSUPP; |
} |
} |
|
|
|
int |
|
puffs_vfsop_extattrctl(struct mount *mp, int cmd, struct vnode *vp, |
|
int attrnamespace, const char *attrname) |
|
{ |
|
PUFFS_MSG_VARS(vfs, extattrctl); |
|
struct puffs_mount *pmp = MPTOPUFFSMP(mp); |
|
struct puffs_node *pnp; |
|
puffs_cookie_t pnc; |
|
int error, flags; |
|
|
|
if (vp) { |
|
/* doesn't make sense for puffs servers */ |
|
if (vp->v_mount != mp) |
|
return EXDEV; |
|
pnp = vp->v_data; |
|
pnc = pnp->pn_cookie; |
|
flags = PUFFS_EXTATTRCTL_HASNODE; |
|
} else { |
|
pnp = pnc = NULL; |
|
flags = 0; |
|
} |
|
|
|
PUFFS_MSG_ALLOC(vfs, extattrctl); |
|
extattrctl_msg->pvfsr_cmd = cmd; |
|
extattrctl_msg->pvfsr_attrnamespace = attrnamespace; |
|
extattrctl_msg->pvfsr_flags = flags; |
|
if (attrname) { |
|
strlcpy(extattrctl_msg->pvfsr_attrname, attrname, |
|
sizeof(extattrctl_msg->pvfsr_attrname)); |
|
extattrctl_msg->pvfsr_flags |= PUFFS_EXTATTRCTL_HASATTRNAME; |
|
} |
|
puffs_msg_setinfo(park_extattrctl, |
|
PUFFSOP_VFS, PUFFS_VFS_EXTATTRCTL, pnc); |
|
|
|
puffs_msg_enqueue(pmp, park_extattrctl); |
|
if (vp) { |
|
mutex_enter(&pnp->pn_mtx); |
|
puffs_referencenode(pnp); |
|
mutex_exit(&pnp->pn_mtx); |
|
VOP_UNLOCK(vp); |
|
} |
|
error = puffs_msg_wait2(pmp, park_extattrctl, pnp, NULL); |
|
PUFFS_MSG_RELEASE(extattrctl); |
|
if (vp) { |
|
puffs_releasenode(pnp); |
|
} |
|
|
|
return checkerr(pmp, error, __func__); |
|
} |
|
|
const struct vnodeopv_desc * const puffs_vnodeopv_descs[] = { |
const struct vnodeopv_desc * const puffs_vnodeopv_descs[] = { |
&puffs_vnodeop_opv_desc, |
&puffs_vnodeop_opv_desc, |
&puffs_specop_opv_desc, |
&puffs_specop_opv_desc, |
Line 784 struct vfsops puffs_vfsops = { |
|
Line 853 struct vfsops puffs_vfsops = { |
|
puffs_vfsop_done, /* done */ |
puffs_vfsop_done, /* done */ |
NULL, /* mountroot */ |
NULL, /* mountroot */ |
puffs_vfsop_snapshot, /* snapshot */ |
puffs_vfsop_snapshot, /* snapshot */ |
vfs_stdextattrctl, /* extattrctl */ |
puffs_vfsop_extattrctl, /* extattrctl */ |
(void *)eopnotsupp, /* suspendctl */ |
(void *)eopnotsupp, /* suspendctl */ |
genfs_renamelock_enter, |
genfs_renamelock_enter, |
genfs_renamelock_exit, |
genfs_renamelock_exit, |