summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-08-12 15:00:40 -0300
committerRenato Botelho <renato@netgate.com>2016-08-12 15:00:40 -0300
commit99990a0d149f0eae805aa1f49d4a61be30c3b000 (patch)
tree806fd460afaba3315461e135d491b22ffe037e21
parente533657bf2edd106dace326fed9deb016f181e0a (diff)
parent1aa48531a6837f05a22a2d17736c03d59bf37ea9 (diff)
downloadFreeBSD-src-99990a0d149f0eae805aa1f49d4a61be30c3b000.zip
FreeBSD-src-99990a0d149f0eae805aa1f49d4a61be30c3b000.tar.gz
Merge remote-tracking branch 'origin/stable/10' into devel
-rw-r--r--release/Makefile.gce6
-rwxr-xr-xshare/examples/bhyve/vmrun.sh2
-rw-r--r--sys/dev/sound/usb/uaudio.c22
-rw-r--r--sys/dev/usb/controller/xhci.h2
-rw-r--r--sys/fs/nfsclient/nfs_clbio.c14
-rw-r--r--sys/fs/nfsclient/nfs_clsubs.c33
-rw-r--r--sys/fs/nfsclient/nfs_clvnops.c10
-rw-r--r--sys/fs/nfsclient/nfsnode.h1
-rw-r--r--sys/fs/pseudofs/pseudofs.c6
-rw-r--r--sys/fs/pseudofs/pseudofs.h14
-rw-r--r--sys/fs/pseudofs/pseudofs_fileno.c2
-rw-r--r--sys/fs/pseudofs/pseudofs_vncache.c2
-rw-r--r--sys/vm/vm_pageout.c2
13 files changed, 51 insertions, 65 deletions
diff --git a/release/Makefile.gce b/release/Makefile.gce
index b6b6577..5bdfb5d 100644
--- a/release/Makefile.gce
+++ b/release/Makefile.gce
@@ -35,7 +35,7 @@ gce-check-depends:
@false
. endif
.endfor
-.if !exists(/usr/local/bin/gcutil)
+.if !exists(/usr/local/bin/gcloud)
. if !exists(${PORTSDIR}/net/google-cloud-sdk/Makefile)
. if !exists(/usr/local/sbin/pkg-static)
env ASSUME_ALWAYS_YES=yes pkg bootstrap -yf
@@ -63,7 +63,7 @@ gce-do-upload:
/usr/local/bin/gsutil mb gs://${GCE_BUCKET} || true
/usr/local/bin/gsutil cp ${.OBJDIR}/${GCE_TARGET}.tar.gz \
gs://${GCE_BUCKET}/
- /usr/local/bin/gcutil addimage ${GCE_TARGET} \
- gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
+ /usr/local/bin/gcloud compute images create ${GCE_TARGET} \
+ --source-uri gs://${GCE_BUCKET}/${GCE_TARGET}.tar.gz
touch ${.OBJDIR}/${.TARGET}
diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh
index 72193de..b2f2195 100755
--- a/share/examples/bhyve/vmrun.sh
+++ b/share/examples/bhyve/vmrun.sh
@@ -177,7 +177,7 @@ make_and_check_diskdev()
{
local virtio_diskdev="$1"
# Create the virtio diskdev file if needed
- if [ ! -f ${virtio_diskdev} ]; then
+ if [ ! -e ${virtio_diskdev} ]; then
echo "virtio disk device file \"${virtio_diskdev}\" does not exist."
echo "Creating it ..."
truncate -s 8G ${virtio_diskdev} > /dev/null
diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c
index 0855134..e3b052a 100644
--- a/sys/dev/sound/usb/uaudio.c
+++ b/sys/dev/sound/usb/uaudio.c
@@ -663,6 +663,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_OUT,
.bufsize = UMIDI_TX_BUFFER,
+ .flags = {.no_pipe_ok = 1},
.callback = &umidi_bulk_write_callback,
},
@@ -671,7 +672,7 @@ static const struct usb_config
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.bufsize = 4, /* bytes */
- .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,},
+ .flags = {.short_xfer_ok = 1,.proxy_buffer = 1,.no_pipe_ok = 1},
.callback = &umidi_bulk_read_callback,
},
};
@@ -5760,7 +5761,16 @@ umidi_start_write(struct usb_fifo *fifo)
{
struct umidi_chan *chan = usb_fifo_softc(fifo);
- usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+ if (chan->xfer[UMIDI_TX_TRANSFER] == NULL) {
+ uint8_t buf[1];
+ int actlen;
+ do {
+ /* dump data */
+ usb_fifo_get_data_linear(fifo, buf, 1, &actlen, 0);
+ } while (actlen > 0);
+ } else {
+ usbd_transfer_start(chan->xfer[UMIDI_TX_TRANSFER]);
+ }
}
static void
@@ -5878,6 +5888,11 @@ umidi_probe(device_t dev)
DPRINTF("error=%s\n", usbd_errstr(error));
goto detach;
}
+ if (chan->xfer[UMIDI_TX_TRANSFER] == NULL &&
+ chan->xfer[UMIDI_RX_TRANSFER] == NULL) {
+ DPRINTF("no BULK or INTERRUPT MIDI endpoint(s) found\n");
+ goto detach;
+ }
/*
* Some USB MIDI device makers couldn't resist using
@@ -5891,7 +5906,8 @@ umidi_probe(device_t dev)
* and 64-byte maximum packet sizes for full-speed bulk
* endpoints and 512 bytes for high-speed bulk endpoints."
*/
- if (usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
+ if (chan->xfer[UMIDI_TX_TRANSFER] != NULL &&
+ usbd_xfer_maxp_was_clamped(chan->xfer[UMIDI_TX_TRANSFER]))
chan->single_command = 1;
if (chan->single_command != 0)
diff --git a/sys/dev/usb/controller/xhci.h b/sys/dev/usb/controller/xhci.h
index d4ed740..c50e852 100644
--- a/sys/dev/usb/controller/xhci.h
+++ b/sys/dev/usb/controller/xhci.h
@@ -30,7 +30,7 @@
#define XHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128)
#define XHCI_MAX_ENDPOINTS 32 /* hardcoded - do not change */
-#define XHCI_MAX_SCRATCHPADS 1024
+#define XHCI_MAX_SCRATCHPADS 256 /* theoretical max is 1023 */
#define XHCI_MAX_EVENTS (16 * 13)
#define XHCI_MAX_COMMANDS (16 * 1)
#define XHCI_MAX_RSEG 1
diff --git a/sys/fs/nfsclient/nfs_clbio.c b/sys/fs/nfsclient/nfs_clbio.c
index 5f85eb2..3acc132 100644
--- a/sys/fs/nfsclient/nfs_clbio.c
+++ b/sys/fs/nfsclient/nfs_clbio.c
@@ -105,7 +105,7 @@ ncl_getpages(struct vop_getpages_args *ap)
count = ap->a_count;
if ((object = vp->v_object) == NULL) {
- ncl_printf("nfs_getpages: called with non-merged cache vnode??\n");
+ printf("ncl_getpages: called with non-merged cache vnode\n");
return (VM_PAGER_ERROR);
}
@@ -113,7 +113,7 @@ ncl_getpages(struct vop_getpages_args *ap)
mtx_lock(&np->n_mtx);
if ((np->n_flag & NNONCACHE) && (vp->v_type == VREG)) {
mtx_unlock(&np->n_mtx);
- ncl_printf("nfs_getpages: called on non-cacheable vnode??\n");
+ printf("ncl_getpages: called on non-cacheable vnode\n");
return (VM_PAGER_ERROR);
} else
mtx_unlock(&np->n_mtx);
@@ -176,7 +176,7 @@ ncl_getpages(struct vop_getpages_args *ap)
relpbuf(bp, &ncl_pbuf_freecnt);
if (error && (uio.uio_resid == count)) {
- ncl_printf("nfs_getpages: error %d\n", error);
+ printf("ncl_getpages: error %d\n", error);
VM_OBJECT_WLOCK(object);
for (i = 0; i < npages; ++i) {
if (i != ap->a_reqpage) {
@@ -283,7 +283,7 @@ ncl_putpages(struct vop_putpages_args *ap)
if (newnfs_directio_enable && !newnfs_directio_allow_mmap &&
(np->n_flag & NNONCACHE) && (vp->v_type == VREG)) {
mtx_unlock(&np->n_mtx);
- ncl_printf("ncl_putpages: called on noncache-able vnode??\n");
+ printf("ncl_putpages: called on noncache-able vnode\n");
mtx_lock(&np->n_mtx);
}
@@ -694,7 +694,7 @@ ncl_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
n = np->n_direofoffset - uio->uio_offset;
break;
default:
- ncl_printf(" ncl_bioread: type %x unexpected\n", vp->v_type);
+ printf(" ncl_bioread: type %x unexpected\n", vp->v_type);
bp = NULL;
break;
};
@@ -1137,7 +1137,7 @@ again:
*/
if (bp->b_dirtyend > bcount) {
- ncl_printf("NFS append race @%lx:%d\n",
+ printf("NFS append race @%lx:%d\n",
(long)bp->b_blkno * DEV_BSIZE,
bp->b_dirtyend - bcount);
bp->b_dirtyend = bcount;
@@ -1678,7 +1678,7 @@ ncl_doio(struct vnode *vp, struct buf *bp, struct ucred *cr, struct thread *td,
bp->b_flags |= B_INVAL;
break;
default:
- ncl_printf("ncl_doio: type %x unexpected\n", vp->v_type);
+ printf("ncl_doio: type %x unexpected\n", vp->v_type);
break;
};
if (error) {
diff --git a/sys/fs/nfsclient/nfs_clsubs.c b/sys/fs/nfsclient/nfs_clsubs.c
index 1629cf3..e4848ff 100644
--- a/sys/fs/nfsclient/nfs_clsubs.c
+++ b/sys/fs/nfsclient/nfs_clsubs.c
@@ -163,18 +163,6 @@ ncl_downgrade_vnlock(struct vnode *vp, int old_lock)
}
}
-void
-ncl_printf(const char *fmt, ...)
-{
- va_list ap;
-
- mtx_lock(&Giant);
- va_start(ap, fmt);
- vprintf(fmt, ap);
- va_end(ap);
- mtx_unlock(&Giant);
-}
-
#ifdef NFS_ACDEBUG
#include <sys/sysctl.h>
SYSCTL_DECL(_vfs_nfs);
@@ -199,16 +187,13 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
vap = &np->n_vattr.na_vattr;
nmp = VFSTONFS(vp->v_mount);
mustflush = nfscl_mustflush(vp); /* must be before mtx_lock() */
-#ifdef NFS_ACDEBUG
- mtx_lock(&Giant); /* ncl_printf() */
-#endif
mtx_lock(&np->n_mtx);
/* XXX n_mtime doesn't seem to be updated on a miss-and-reload */
timeo = (time_second - np->n_mtime.tv_sec) / 10;
#ifdef NFS_ACDEBUG
if (nfs_acdebug>1)
- ncl_printf("nfs_getattrcache: initial timeo = %d\n", timeo);
+ printf("ncl_getattrcache: initial timeo = %d\n", timeo);
#endif
if (vap->va_type == VDIR) {
@@ -225,22 +210,19 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
#ifdef NFS_ACDEBUG
if (nfs_acdebug > 2)
- ncl_printf("acregmin %d; acregmax %d; acdirmin %d; acdirmax %d\n",
- nmp->nm_acregmin, nmp->nm_acregmax,
- nmp->nm_acdirmin, nmp->nm_acdirmax);
+ printf("acregmin %d; acregmax %d; acdirmin %d; acdirmax %d\n",
+ nmp->nm_acregmin, nmp->nm_acregmax,
+ nmp->nm_acdirmin, nmp->nm_acdirmax);
if (nfs_acdebug)
- ncl_printf("nfs_getattrcache: age = %d; final timeo = %d\n",
- (time_second - np->n_attrstamp), timeo);
+ printf("ncl_getattrcache: age = %d; final timeo = %d\n",
+ (time_second - np->n_attrstamp), timeo);
#endif
if ((time_second - np->n_attrstamp) >= timeo &&
(mustflush != 0 || np->n_attrstamp == 0)) {
newnfsstats.attrcache_misses++;
mtx_unlock(&np->n_mtx);
-#ifdef NFS_ACDEBUG
- mtx_unlock(&Giant); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_MISS(vp);
return( ENOENT);
}
@@ -268,9 +250,6 @@ ncl_getattrcache(struct vnode *vp, struct vattr *vaper)
vaper->va_mtime = np->n_mtim;
}
mtx_unlock(&np->n_mtx);
-#ifdef NFS_ACDEBUG
- mtx_unlock(&Giant); /* ncl_printf() */
-#endif
KDTRACE_NFS_ATTRCACHE_GET_HIT(vp, vap);
return (0);
}
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c
index faff121..d6f9011 100644
--- a/sys/fs/nfsclient/nfs_clvnops.c
+++ b/sys/fs/nfsclient/nfs_clvnops.c
@@ -1786,7 +1786,7 @@ nfs_rename(struct vop_rename_args *ap)
}
if (fvp == tvp) {
- ncl_printf("nfs_rename: fvp == tvp (can't happen)\n");
+ printf("nfs_rename: fvp == tvp (can't happen)\n");
error = 0;
goto out;
}
@@ -2314,7 +2314,7 @@ ncl_readdirrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
dnp->n_direofoffset = uiop->uio_offset;
else {
if (uiop->uio_resid > 0)
- ncl_printf("EEK! readdirrpc resid > 0\n");
+ printf("EEK! readdirrpc resid > 0\n");
ncl_dircookie_lock(dnp);
cookiep = ncl_getcookie(dnp, uiop->uio_offset, 1);
*cookiep = cookie;
@@ -2373,7 +2373,7 @@ ncl_readdirplusrpc(struct vnode *vp, struct uio *uiop, struct ucred *cred,
dnp->n_direofoffset = uiop->uio_offset;
else {
if (uiop->uio_resid > 0)
- ncl_printf("EEK! readdirplusrpc resid > 0\n");
+ printf("EEK! readdirplusrpc resid > 0\n");
ncl_dircookie_lock(dnp);
cookiep = ncl_getcookie(dnp, uiop->uio_offset, 1);
*cookiep = cookie;
@@ -3146,8 +3146,8 @@ nfs_print(struct vop_print_args *ap)
struct vnode *vp = ap->a_vp;
struct nfsnode *np = VTONFS(vp);
- ncl_printf("\tfileid %ld fsid 0x%x",
- np->n_vattr.na_fileid, np->n_vattr.na_fsid);
+ printf("\tfileid %ld fsid 0x%x", np->n_vattr.na_fileid,
+ np->n_vattr.na_fsid);
if (vp->v_type == VFIFO)
fifo_printinfo(vp);
printf("\n");
diff --git a/sys/fs/nfsclient/nfsnode.h b/sys/fs/nfsclient/nfsnode.h
index d5cb756..65f6c10 100644
--- a/sys/fs/nfsclient/nfsnode.h
+++ b/sys/fs/nfsclient/nfsnode.h
@@ -185,7 +185,6 @@ nfsuint64 *ncl_getcookie(struct nfsnode *, off_t, int);
void ncl_invaldir(struct vnode *);
int ncl_upgrade_vnlock(struct vnode *);
void ncl_downgrade_vnlock(struct vnode *, int);
-void ncl_printf(const char *, ...);
void ncl_dircookie_lock(struct nfsnode *);
void ncl_dircookie_unlock(struct nfsnode *);
diff --git a/sys/fs/pseudofs/pseudofs.c b/sys/fs/pseudofs/pseudofs.c
index 1824d0b..b2ae67f 100644
--- a/sys/fs/pseudofs/pseudofs.c
+++ b/sys/fs/pseudofs/pseudofs.c
@@ -383,11 +383,9 @@ pfs_init(struct pfs_info *pi, struct vfsconf *vfc)
struct pfs_node *root;
int error;
- mtx_assert(&Giant, MA_OWNED);
-
pfs_fileno_init(pi);
- /* set up the root diretory */
+ /* set up the root directory */
root = pfs_alloc_node(pi, "/", pfstype_root);
pi->pi_root = root;
pfs_fileno_alloc(root);
@@ -414,8 +412,6 @@ pfs_uninit(struct pfs_info *pi, struct vfsconf *vfc)
{
int error;
- mtx_assert(&Giant, MA_OWNED);
-
pfs_destroy(pi->pi_root);
pi->pi_root = NULL;
pfs_fileno_uninit(pi);
diff --git a/sys/fs/pseudofs/pseudofs.h b/sys/fs/pseudofs/pseudofs.h
index e2aeed6..cc9b841 100644
--- a/sys/fs/pseudofs/pseudofs.h
+++ b/sys/fs/pseudofs/pseudofs.h
@@ -189,16 +189,16 @@ typedef int (*pfs_destroy_t)(PFS_DESTROY_ARGS);
/*
* pfs_info: describes a pseudofs instance
*
- * The pi_mutex is only used to avoid using the global subr_unit lock for
- * unrhdr. The rest of struct pfs_info is only modified while Giant is
- * held (during vfs_init() and vfs_uninit()).
+ * The pi_mutex is only used to avoid using the global subr_unit lock
+ * for unrhdr. The rest of struct pfs_info is only modified during
+ * vfs_init() and vfs_uninit() of the consumer filesystem.
*/
struct pfs_info {
char pi_name[PFS_FSNAMELEN];
pfs_init_t pi_init;
pfs_init_t pi_uninit;
- /* members below this line are initialized at run time*/
+ /* members below this line are initialized at run time */
struct pfs_node *pi_root;
struct mtx pi_mutex;
struct unrhdr *pi_unrhdr;
@@ -285,17 +285,17 @@ static int \
_##name##_mount(struct mount *mp) { \
if (jflag && !prison_allow(curthread->td_ucred, jflag)) \
return (EPERM); \
- return pfs_mount(&name##_info, mp); \
+ return (pfs_mount(&name##_info, mp)); \
} \
\
static int \
_##name##_init(struct vfsconf *vfc) { \
- return pfs_init(&name##_info, vfc); \
+ return (pfs_init(&name##_info, vfc)); \
} \
\
static int \
_##name##_uninit(struct vfsconf *vfc) { \
- return pfs_uninit(&name##_info, vfc); \
+ return (pfs_uninit(&name##_info, vfc)); \
} \
\
static struct vfsops name##_vfsops = { \
diff --git a/sys/fs/pseudofs/pseudofs_fileno.c b/sys/fs/pseudofs/pseudofs_fileno.c
index a8c034f..f57731c 100644
--- a/sys/fs/pseudofs/pseudofs_fileno.c
+++ b/sys/fs/pseudofs/pseudofs_fileno.c
@@ -52,7 +52,6 @@ void
pfs_fileno_init(struct pfs_info *pi)
{
- mtx_assert(&Giant, MA_OWNED);
mtx_init(&pi->pi_mutex, "pfs_fileno", NULL, MTX_DEF);
pi->pi_unrhdr = new_unrhdr(3, INT_MAX / NO_PID, &pi->pi_mutex);
}
@@ -64,7 +63,6 @@ void
pfs_fileno_uninit(struct pfs_info *pi)
{
- mtx_assert(&Giant, MA_OWNED);
delete_unrhdr(pi->pi_unrhdr);
pi->pi_unrhdr = NULL;
mtx_destroy(&pi->pi_mutex);
diff --git a/sys/fs/pseudofs/pseudofs_vncache.c b/sys/fs/pseudofs/pseudofs_vncache.c
index 1f9c043..1bec5a4 100644
--- a/sys/fs/pseudofs/pseudofs_vncache.c
+++ b/sys/fs/pseudofs/pseudofs_vncache.c
@@ -84,7 +84,6 @@ void
pfs_vncache_load(void)
{
- mtx_assert(&Giant, MA_OWNED);
mtx_init(&pfs_vncache_mutex, "pfs_vncache", NULL, MTX_DEF);
pfs_exit_tag = EVENTHANDLER_REGISTER(process_exit, pfs_exit, NULL,
EVENTHANDLER_PRI_ANY);
@@ -97,7 +96,6 @@ void
pfs_vncache_unload(void)
{
- mtx_assert(&Giant, MA_OWNED);
EVENTHANDLER_DEREGISTER(process_exit, pfs_exit_tag);
KASSERT(pfs_vncache_entries == 0,
("%d vncache entries remaining", pfs_vncache_entries));
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
index 4a5d2c7..0d81be4 100644
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -243,7 +243,7 @@ static boolean_t vm_pageout_page_lock(vm_page_t, vm_page_t *);
/*
* Initialize a dummy page for marking the caller's place in the specified
* paging queue. In principle, this function only needs to set the flag
- * PG_MARKER. Nonetheless, it wirte busies and initializes the hold count
+ * PG_MARKER. Nonetheless, it write busies and initializes the hold count
* to one as safety precautions.
*/
static void
OpenPOWER on IntegriCloud