summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorthompsa <thompsa@FreeBSD.org>2009-04-10 04:08:34 +0000
committerthompsa <thompsa@FreeBSD.org>2009-04-10 04:08:34 +0000
commit39714cb212e38a31abbdf01349fcc0211dd6f073 (patch)
tree706f3f29e2642dfa022bcec35abbf79ceff4a024 /sys
parent9fcc70de74585cb50ad7e66252ee1d76b7fdce9a (diff)
downloadFreeBSD-src-39714cb212e38a31abbdf01349fcc0211dd6f073.zip
FreeBSD-src-39714cb212e38a31abbdf01349fcc0211dd6f073.tar.gz
Revert r190676,190677
The geom and CAM changes for root_hold are the wrong solution for USB design quirks. Requested by: scottl
Diffstat (limited to 'sys')
-rw-r--r--sys/cam/cam_xpt.c6
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c2
-rw-r--r--sys/dev/pccbb/pccbb_pci.c2
-rw-r--r--sys/dev/usb/controller/usb_controller.c2
-rw-r--r--sys/geom/geom.h2
-rw-r--r--sys/geom/geom_disk.c2
-rw-r--r--sys/geom/geom_disk.h2
-rw-r--r--sys/geom/geom_subr.c5
-rw-r--r--sys/geom/journal/g_journal.c2
-rw-r--r--sys/geom/mirror/g_mirror.c2
-rw-r--r--sys/geom/part/g_part.c2
-rw-r--r--sys/geom/raid3/g_raid3.c2
-rw-r--r--sys/kern/vfs_mount.c8
-rw-r--r--sys/sys/systm.h2
14 files changed, 10 insertions, 31 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 2fe895c..08286db 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -5139,7 +5139,6 @@ xpt_find_device(struct cam_et *target, lun_id_t lun_id)
typedef struct {
union ccb *request_ccb;
struct ccb_pathinq *cpi;
- struct root_hold_token *roothold;
int counter;
} xpt_scan_bus_info;
@@ -5202,7 +5201,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
}
scan_info->request_ccb = request_ccb;
scan_info->cpi = &work_ccb->cpi;
- scan_info->roothold = root_mount_hold("CAM", M_NOWAIT);
/* Cache on our stack so we can work asynchronously */
max_target = scan_info->cpi->max_target;
@@ -5234,7 +5232,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
printf("xpt_scan_bus: xpt_create_path failed"
" with status %#x, bus scan halted\n",
status);
- root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_free_ccb(work_ccb);
@@ -5243,7 +5240,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
}
work_ccb = xpt_alloc_ccb_nowait();
if (work_ccb == NULL) {
- root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
xpt_free_path(path);
request_ccb->ccb_h.status = CAM_RESRC_UNAVAIL;
@@ -5357,7 +5353,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
xpt_free_ccb(request_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
- root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = CAM_REQ_CMP;
xpt_done(request_ccb);
@@ -5377,7 +5372,6 @@ xpt_scan_bus(struct cam_periph *periph, union ccb *request_ccb)
xpt_free_ccb(request_ccb);
xpt_free_ccb((union ccb *)scan_info->cpi);
request_ccb = scan_info->request_ccb;
- root_mount_rel(scan_info->roothold);
free(scan_info, M_CAMXPT);
request_ccb->ccb_h.status = status;
xpt_done(request_ccb);
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
index e91695b..a6829eb 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c
@@ -3087,7 +3087,7 @@ zfs_modevent(module_t mod, int type, void *unused __unused)
error = EOPNOTSUPP;
switch (type) {
case MOD_LOAD:
- zfs_root_token = root_mount_hold("ZFS", M_WAITOK);
+ zfs_root_token = root_mount_hold("ZFS");
printf("WARNING: ZFS is considered to be an experimental "
"feature in FreeBSD.\n");
TASK_INIT(&zfs_start_task, 0, zfs_start, NULL);
diff --git a/sys/dev/pccbb/pccbb_pci.c b/sys/dev/pccbb/pccbb_pci.c
index 4fcd7ea..c89e5ad 100644
--- a/sys/dev/pccbb/pccbb_pci.c
+++ b/sys/dev/pccbb/pccbb_pci.c
@@ -439,7 +439,7 @@ cbb_pci_attach(device_t brdev)
device_printf(brdev, "unable to create event thread.\n");
panic("cbb_create_event_thread");
}
- sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev), M_WAITOK);
+ sc->sc_root_token = root_mount_hold(device_get_nameunit(sc->dev));
return (0);
err:
if (sc->irq_res)
diff --git a/sys/dev/usb/controller/usb_controller.c b/sys/dev/usb/controller/usb_controller.c
index 77ff430..474cbe5 100644
--- a/sys/dev/usb/controller/usb_controller.c
+++ b/sys/dev/usb/controller/usb_controller.c
@@ -114,7 +114,7 @@ usb2_attach(device_t dev)
}
/* delay vfs_mountroot until the bus is explored */
- bus->bus_roothold = root_mount_hold(device_get_nameunit(dev), M_WAITOK);
+ bus->bus_roothold = root_mount_hold(device_get_nameunit(dev));
if (usb2_post_init_called) {
mtx_lock(&Giant);
diff --git a/sys/geom/geom.h b/sys/geom/geom.h
index 38c6c75..a916ec5 100644
--- a/sys/geom/geom.h
+++ b/sys/geom/geom.h
@@ -193,8 +193,6 @@ struct g_provider {
/* Two fields for the implementing class to use */
void *private;
u_int index;
-
- struct root_hold_token *roothold;
};
/* geom_dev.c */
diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c
index 3b1e748..20998bd 100644
--- a/sys/geom/geom_disk.c
+++ b/sys/geom/geom_disk.c
@@ -381,7 +381,6 @@ g_disk_create(void *arg, int flag)
printf("GEOM: new disk %s\n", gp->name);
dp->d_geom = gp;
g_error_provider(pp, 0);
- root_mount_rel(dp->d_roothold);
}
static void
@@ -468,7 +467,6 @@ disk_create(struct disk *dp, int version)
dp->d_sectorsize, DEVSTAT_ALL_SUPPORTED,
DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX);
dp->d_geom = NULL;
- dp->d_roothold = root_mount_hold(dp->d_name, M_WAITOK);
g_disk_ident_adjust(dp->d_ident, sizeof(dp->d_ident));
g_post_event(g_disk_create, dp, M_WAITOK, dp, NULL);
}
diff --git a/sys/geom/geom_disk.h b/sys/geom/geom_disk.h
index a3e1efb..5e9d1aa 100644
--- a/sys/geom/geom_disk.h
+++ b/sys/geom/geom_disk.h
@@ -88,8 +88,6 @@ struct disk {
/* Fields private to the driver */
void *d_drv1;
-
- struct root_hold_token *d_roothold;
};
#define DISKFLAG_NEEDSGIANT 0x1
diff --git a/sys/geom/geom_subr.c b/sys/geom/geom_subr.c
index 85d8028..b67c0d5 100644
--- a/sys/geom/geom_subr.c
+++ b/sys/geom/geom_subr.c
@@ -545,10 +545,6 @@ g_new_provider_event(void *arg, int flag)
mp->taste(mp, pp, 0);
g_topology_assert();
}
- if (pp->roothold != NULL) {
- root_mount_rel(pp->roothold);
- pp->roothold = NULL;
- }
}
@@ -585,7 +581,6 @@ g_new_providerf(struct g_geom *gp, const char *fmt, ...)
pp->stat = devstat_new_entry(pp, -1, 0, DEVSTAT_ALL_SUPPORTED,
DEVSTAT_TYPE_DIRECT, DEVSTAT_PRIORITY_MAX);
LIST_INSERT_HEAD(&gp->provider, pp, provider);
- pp->roothold = root_mount_hold(pp->name, M_WAITOK);
g_post_event(g_new_provider_event, pp, M_WAITOK, pp, gp, NULL);
return (pp);
}
diff --git a/sys/geom/journal/g_journal.c b/sys/geom/journal/g_journal.c
index d3274a2..2db2364 100644
--- a/sys/geom/journal/g_journal.c
+++ b/sys/geom/journal/g_journal.c
@@ -2310,7 +2310,7 @@ g_journal_create(struct g_class *mp, struct g_provider *pp,
sc->sc_inactive.jj_queue = NULL;
sc->sc_active.jj_queue = NULL;
- sc->sc_rootmount = root_mount_hold("GJOURNAL", M_WAITOK);
+ sc->sc_rootmount = root_mount_hold("GJOURNAL");
GJ_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount);
callout_init(&sc->sc_callout, CALLOUT_MPSAFE);
diff --git a/sys/geom/mirror/g_mirror.c b/sys/geom/mirror/g_mirror.c
index 85b5b24..13ff6ea 100644
--- a/sys/geom/mirror/g_mirror.c
+++ b/sys/geom/mirror/g_mirror.c
@@ -2907,7 +2907,7 @@ g_mirror_create(struct g_class *mp, const struct g_mirror_metadata *md)
G_MIRROR_DEBUG(1, "Device %s created (%u components, id=%u).",
sc->sc_name, sc->sc_ndisks, sc->sc_id);
- sc->sc_rootmount = root_mount_hold("GMIRROR", M_WAITOK);
+ sc->sc_rootmount = root_mount_hold("GMIRROR");
G_MIRROR_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount);
/*
* Run timeout.
diff --git a/sys/geom/part/g_part.c b/sys/geom/part/g_part.c
index 58fa797..447221a 100644
--- a/sys/geom/part/g_part.c
+++ b/sys/geom/part/g_part.c
@@ -1474,7 +1474,7 @@ g_part_taste(struct g_class *mp, struct g_provider *pp, int flags __unused)
return (NULL);
}
- rht = root_mount_hold(mp->name, M_WAITOK);
+ rht = root_mount_hold(mp->name);
g_topology_unlock();
/*
diff --git a/sys/geom/raid3/g_raid3.c b/sys/geom/raid3/g_raid3.c
index cb19ef2..1cbce25 100644
--- a/sys/geom/raid3/g_raid3.c
+++ b/sys/geom/raid3/g_raid3.c
@@ -3193,7 +3193,7 @@ g_raid3_create(struct g_class *mp, const struct g_raid3_metadata *md)
G_RAID3_DEBUG(1, "Device %s created (%u components, id=%u).",
sc->sc_name, sc->sc_ndisks, sc->sc_id);
- sc->sc_rootmount = root_mount_hold("GRAID3", M_WAITOK);
+ sc->sc_rootmount = root_mount_hold("GRAID3");
G_RAID3_DEBUG(1, "root_mount_hold %p", sc->sc_rootmount);
/*
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 164eb12..e4256c7 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1353,18 +1353,14 @@ static int root_mount_complete;
* Hold root mount.
*/
struct root_hold_token *
-root_mount_hold(const char *identifier, int how)
+root_mount_hold(const char *identifier)
{
struct root_hold_token *h;
if (root_mounted())
return (NULL);
- h = malloc(sizeof *h, M_DEVBUF, M_ZERO | how);
- if (h == NULL) {
- printf("Unable to alloc root hold token for %s\n", identifier);
- return (NULL);
- }
+ h = malloc(sizeof *h, M_DEVBUF, M_ZERO | M_WAITOK);
h->who = identifier;
mtx_lock(&mountlist_mtx);
LIST_INSERT_HEAD(&root_holds, h, list);
diff --git a/sys/sys/systm.h b/sys/sys/systm.h
index 244d218..31fb750 100644
--- a/sys/sys/systm.h
+++ b/sys/sys/systm.h
@@ -325,7 +325,7 @@ void DELAY(int usec);
/* Root mount holdback API */
struct root_hold_token;
-struct root_hold_token *root_mount_hold(const char *identifier, int how);
+struct root_hold_token *root_mount_hold(const char *identifier);
void root_mount_rel(struct root_hold_token *h);
void root_mount_wait(void);
int root_mounted(void);
OpenPOWER on IntegriCloud