blkback.c (214444) | blkback.c (222975) |
---|---|
1/*- 2 * Copyright (c) 2009-2010 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGES. 29 * 30 * Authors: Justin T. Gibbs (Spectra Logic Corporation) 31 * Ken Merry (Spectra Logic Corporation) 32 */ 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2009-2010 Spectra Logic Corporation 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 27 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGES. 29 * 30 * Authors: Justin T. Gibbs (Spectra Logic Corporation) 31 * Ken Merry (Spectra Logic Corporation) 32 */ 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/dev/xen/blkback/blkback.c 214444 2010-10-28 04:14:28Z gibbs $"); | 34__FBSDID("$FreeBSD: head/sys/dev/xen/blkback/blkback.c 222975 2011-06-11 04:59:01Z gibbs $"); |
35 36/** 37 * \file blkback.c 38 * 39 * \brief Device driver supporting the vending of block storage from 40 * a FreeBSD domain to other domains. 41 */ 42 --- 2873 unchanged lines hidden (view full) --- 2916 * Handle state changes expressed via the XenStore by our front-end peer. 2917 * 2918 * \param dev NewBus device object representing this Xen 2919 * Block Back instance. 2920 * \param frontend_state The new state of the front-end. 2921 * 2922 * \return 0 for success, errno codes for failure. 2923 */ | 35 36/** 37 * \file blkback.c 38 * 39 * \brief Device driver supporting the vending of block storage from 40 * a FreeBSD domain to other domains. 41 */ 42 --- 2873 unchanged lines hidden (view full) --- 2916 * Handle state changes expressed via the XenStore by our front-end peer. 2917 * 2918 * \param dev NewBus device object representing this Xen 2919 * Block Back instance. 2920 * \param frontend_state The new state of the front-end. 2921 * 2922 * \return 0 for success, errno codes for failure. 2923 */ |
2924static int | 2924static void |
2925xbb_frontend_changed(device_t dev, XenbusState frontend_state) 2926{ 2927 struct xbb_softc *xbb = device_get_softc(dev); 2928 2929 DPRINTF("state=%s\n", xenbus_strstate(frontend_state)); 2930 2931 switch (frontend_state) { 2932 case XenbusStateInitialising: --- 10 unchanged lines hidden (view full) --- 2943 xbb_shutdown(xbb); 2944 mtx_unlock(&xbb->lock); 2945 break; 2946 default: 2947 xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend", 2948 frontend_state); 2949 break; 2950 } | 2925xbb_frontend_changed(device_t dev, XenbusState frontend_state) 2926{ 2927 struct xbb_softc *xbb = device_get_softc(dev); 2928 2929 DPRINTF("state=%s\n", xenbus_strstate(frontend_state)); 2930 2931 switch (frontend_state) { 2932 case XenbusStateInitialising: --- 10 unchanged lines hidden (view full) --- 2943 xbb_shutdown(xbb); 2944 mtx_unlock(&xbb->lock); 2945 break; 2946 default: 2947 xenbus_dev_fatal(xbb->dev, EINVAL, "saw state %d at frontend", 2948 frontend_state); 2949 break; 2950 } |
2951 return (0); | |
2952} 2953 2954/*---------------------------- NewBus Registration ---------------------------*/ 2955static device_method_t xbb_methods[] = { 2956 /* Device interface */ 2957 DEVMETHOD(device_probe, xbb_probe), 2958 DEVMETHOD(device_attach, xbb_attach), 2959 DEVMETHOD(device_detach, xbb_detach), --- 18 unchanged lines hidden --- | 2951} 2952 2953/*---------------------------- NewBus Registration ---------------------------*/ 2954static device_method_t xbb_methods[] = { 2955 /* Device interface */ 2956 DEVMETHOD(device_probe, xbb_probe), 2957 DEVMETHOD(device_attach, xbb_attach), 2958 DEVMETHOD(device_detach, xbb_detach), --- 18 unchanged lines hidden --- |