Print this page
7127  remove -Wno-missing-braces from Makefile.uts


1111         rw_exit(&VTODV(vp)->dv_contents);
1112 }
1113 
1114 /*
1115  * XXX  Should probably do a better job of computing the maximum
1116  *      offset available in the directory.
1117  */
1118 /*ARGSUSED1*/
1119 static int
1120 devfs_seek(struct vnode *vp, offset_t ooff, offset_t *noffp,
1121     caller_context_t *ct)
1122 {
1123         ASSERT(vp->v_type == VDIR);
1124         dcmn_err2(("devfs_seek %s\n", VTODV(vp)->dv_name));
1125         return ((*noffp < 0 || *noffp > MAXOFFSET_T) ? EINVAL : 0);
1126 }
1127 
1128 vnodeops_t *dv_vnodeops;
1129 
1130 const fs_operation_def_t dv_vnodeops_template[] = {
1131         VOPNAME_OPEN,           { .vop_open = devfs_open },
1132         VOPNAME_CLOSE,          { .vop_close = devfs_close },
1133         VOPNAME_READ,           { .vop_read = devfs_read },
1134         VOPNAME_WRITE,          { .vop_write = devfs_write },
1135         VOPNAME_IOCTL,          { .vop_ioctl = devfs_ioctl },
1136         VOPNAME_GETATTR,        { .vop_getattr = devfs_getattr },
1137         VOPNAME_SETATTR,        { .vop_setattr = devfs_setattr },
1138         VOPNAME_ACCESS,         { .vop_access = devfs_access },
1139         VOPNAME_LOOKUP,         { .vop_lookup = devfs_lookup },
1140         VOPNAME_CREATE,         { .vop_create = devfs_create },
1141         VOPNAME_READDIR,        { .vop_readdir = devfs_readdir },
1142         VOPNAME_FSYNC,          { .vop_fsync = devfs_fsync },
1143         VOPNAME_INACTIVE,       { .vop_inactive = devfs_inactive },
1144         VOPNAME_FID,            { .vop_fid = devfs_fid },
1145         VOPNAME_RWLOCK,         { .vop_rwlock = devfs_rwlock },
1146         VOPNAME_RWUNLOCK,       { .vop_rwunlock = devfs_rwunlock },
1147         VOPNAME_SEEK,           { .vop_seek = devfs_seek },
1148         VOPNAME_PATHCONF,       { .vop_pathconf = devfs_pathconf },
1149         VOPNAME_DISPOSE,        { .error = fs_error },
1150         VOPNAME_SETSECATTR,     { .vop_setsecattr = devfs_setsecattr },
1151         VOPNAME_GETSECATTR,     { .vop_getsecattr = devfs_getsecattr },
1152         NULL,                   NULL
1153 };


1111         rw_exit(&VTODV(vp)->dv_contents);
1112 }
1113 
1114 /*
1115  * XXX  Should probably do a better job of computing the maximum
1116  *      offset available in the directory.
1117  */
1118 /*ARGSUSED1*/
1119 static int
1120 devfs_seek(struct vnode *vp, offset_t ooff, offset_t *noffp,
1121     caller_context_t *ct)
1122 {
1123         ASSERT(vp->v_type == VDIR);
1124         dcmn_err2(("devfs_seek %s\n", VTODV(vp)->dv_name));
1125         return ((*noffp < 0 || *noffp > MAXOFFSET_T) ? EINVAL : 0);
1126 }
1127 
1128 vnodeops_t *dv_vnodeops;
1129 
1130 const fs_operation_def_t dv_vnodeops_template[] = {
1131         { VOPNAME_OPEN,         { .vop_open = devfs_open } },
1132         { VOPNAME_CLOSE,        { .vop_close = devfs_close } },
1133         { VOPNAME_READ,         { .vop_read = devfs_read } },
1134         { VOPNAME_WRITE,        { .vop_write = devfs_write } },
1135         { VOPNAME_IOCTL,        { .vop_ioctl = devfs_ioctl } },
1136         { VOPNAME_GETATTR,      { .vop_getattr = devfs_getattr } },
1137         { VOPNAME_SETATTR,      { .vop_setattr = devfs_setattr } },
1138         { VOPNAME_ACCESS,       { .vop_access = devfs_access } },
1139         { VOPNAME_LOOKUP,       { .vop_lookup = devfs_lookup } },
1140         { VOPNAME_CREATE,       { .vop_create = devfs_create } },
1141         { VOPNAME_READDIR,      { .vop_readdir = devfs_readdir } },
1142         { VOPNAME_FSYNC,        { .vop_fsync = devfs_fsync } },
1143         { VOPNAME_INACTIVE,     { .vop_inactive = devfs_inactive } },
1144         { VOPNAME_FID,          { .vop_fid = devfs_fid } },
1145         { VOPNAME_RWLOCK,       { .vop_rwlock = devfs_rwlock } },
1146         { VOPNAME_RWUNLOCK,     { .vop_rwunlock = devfs_rwunlock } },
1147         { VOPNAME_SEEK,         { .vop_seek = devfs_seek } },
1148         { VOPNAME_PATHCONF,     { .vop_pathconf = devfs_pathconf } },
1149         { VOPNAME_DISPOSE,      { .error = fs_error } },
1150         { VOPNAME_SETSECATTR,   { .vop_setsecattr = devfs_setsecattr } },
1151         { VOPNAME_GETSECATTR,   { .vop_getsecattr = devfs_getsecattr } },
1152         { NULL,                 { NULL } }
1153 };