+2003-08-05 Ion Badulescu <ionut@moisil.badula.org>
+
+ * amd/map.c (get_first_exported_ap, get_next_exported_ap): new
+ functions that facilitate iterating through the list of
+ mountpoints
+
+ * amd/amfs_union.c (amfs_union_mounted): use get_first_exported_ap
+ and get_next_exported_ap
+
+ * conf/autofs/autofs_solaris_v2_v3.c (autofs_unmount_2_req): ditto
+
2003-08-04 Erez Zadok <ezk@ulkesh.dyn.optonline.net>
* configure.in: check if system stores mount tables in files
* SUCH DAMAGE.
*
*
- * $Id: amd.h,v 1.41 2003/08/01 19:16:57 ib42 Exp $
+ * $Id: amd.h,v 1.42 2003/08/05 04:27:45 ib42 Exp $
*
*/
extern void mf_mounted(mntfs *mf);
extern void am_unmounted(am_node *);
extern am_node *get_exported_ap(int index);
+extern am_node *get_first_exported_ap(int *index);
+extern am_node *get_next_exported_ap(int *index);
extern am_node *exported_ap_alloc(void);
extern am_node *find_mf(mntfs *);
extern am_node *next_map(int *);
* SUCH DAMAGE.
*
*
- * $Id: amfs_union.c,v 1.14 2003/07/30 06:56:07 ib42 Exp $
+ * $Id: amfs_union.c,v 1.15 2003/08/05 04:27:45 ib42 Exp $
*
*/
static void
amfs_union_mounted(mntfs *mf)
{
- int i;
+ int index;
+ am_node *mp;
amfs_mkcacheref(mf);
* Having made the union mount point,
* populate all the entries...
*/
- for (i = 0; ;i++) {
- am_node *mp = get_exported_ap(i);
- if (!mp)
- break;
+ for (mp = get_first_exported_ap(&index);
+ mp;
+ mp = get_next_exported_ap(&index)) {
if (mp->am_mnt == mf) {
/* return value from create_amfs_union_node is ignored by mapc_keyiter */
(void) mapc_keyiter((mnt_map *) mp->am_mnt->mf_private,
* SUCH DAMAGE.
*
*
- * $Id: map.c,v 1.42 2003/08/04 20:49:58 ib42 Exp $
+ * $Id: map.c,v 1.43 2003/08/05 04:27:45 ib42 Exp $
*
*/
static am_node *get_root_ap(char *dir);
+/*
+ * Iterator functions for exported_ap[]
+ */
+am_node *
+get_first_exported_ap(int *index)
+{
+ *index = -1;
+ return get_next_exported_ap(index);
+}
+
+
+am_node *
+get_next_exported_ap(int *index)
+{
+ (*index)++;
+ while (exported_ap[*index] == NULL) {
+ if (*index >= exported_ap_size)
+ return NULL;
+ (*index)++;
+ }
+ return exported_ap[*index];
+}
+
+
/*
* Get exported_ap by index
*/
return exported_ap[index];
}
+
/*
* Resize exported_ap map
*/
* SUCH DAMAGE.
*
*
- * $Id: autofs_solaris_v2_v3.c,v 1.33 2003/08/04 23:51:59 ib42 Exp $
+ * $Id: autofs_solaris_v2_v3.c,v 1.34 2003/08/05 04:27:46 ib42 Exp $
*
*/
res->status = 0;
#ifdef HAVE_STRUCT_UMNTREQUEST_DEVID
- for (mapno = 0; ; mapno++) {
- mp = get_exported_ap(mapno);
- if (!mp)
- break;
+ for (mp = get_first_exported_ap(&mapno);
+ mp;
+ mp = get_next_exported_ap(&mapno)) {
if (mp->am_dev == ul->devid &&
mp->am_rdev == ul->rdevid)
break;