|
|
9a499a |
autofs-5.1.7 - remove mounts_mutex
|
|
|
9a499a |
|
|
|
9a499a |
From: Ian Kent <raven@themaw.net>
|
|
|
9a499a |
|
|
|
9a499a |
The mounts_mutex is no longer used, remove it.
|
|
|
9a499a |
|
|
|
9a499a |
Signed-off-by: Ian Kent <raven@themaw.net>
|
|
|
9a499a |
---
|
|
|
9a499a |
CHANGELOG | 1 +
|
|
|
9a499a |
daemon/automount.c | 8 +-------
|
|
|
9a499a |
daemon/master.c | 13 -------------
|
|
|
9a499a |
include/automount.h | 1 -
|
|
|
9a499a |
modules/mount_autofs.c | 8 --------
|
|
|
9a499a |
5 files changed, 2 insertions(+), 29 deletions(-)
|
|
|
9a499a |
|
|
|
9a499a |
--- autofs-5.1.4.orig/CHANGELOG
|
|
|
9a499a |
+++ autofs-5.1.4/CHANGELOG
|
|
|
9a499a |
@@ -48,6 +48,7 @@
|
|
|
9a499a |
- remove unused function master_submount_list_empty().
|
|
|
9a499a |
- move amd mounts removal into lib/mounts.c.
|
|
|
9a499a |
- check for offset with no mount location.
|
|
|
9a499a |
+- remove mounts_mutex.
|
|
|
9a499a |
|
|
|
9a499a |
xx/xx/2018 autofs-5.1.5
|
|
|
9a499a |
- fix flag file permission.
|
|
|
9a499a |
--- autofs-5.1.4.orig/daemon/automount.c
|
|
|
9a499a |
+++ autofs-5.1.4/daemon/automount.c
|
|
|
9a499a |
@@ -1749,7 +1749,6 @@ static void handle_mounts_cleanup(void *
|
|
|
9a499a |
* here.
|
|
|
9a499a |
*/
|
|
|
9a499a |
if (submount) {
|
|
|
9a499a |
- mounts_mutex_unlock(ap->parent);
|
|
|
9a499a |
master_source_unlock(ap->parent->entry);
|
|
|
9a499a |
master_free_mapent_sources(ap->entry, 1);
|
|
|
9a499a |
master_free_mapent(ap->entry);
|
|
|
9a499a |
@@ -1787,13 +1786,9 @@ static int submount_source_writelock_nes
|
|
|
9a499a |
if (status)
|
|
|
9a499a |
goto done;
|
|
|
9a499a |
|
|
|
9a499a |
- mounts_mutex_lock(parent);
|
|
|
9a499a |
-
|
|
|
9a499a |
status = pthread_rwlock_trywrlock(&ap->entry->source_lock);
|
|
|
9a499a |
- if (status) {
|
|
|
9a499a |
- mounts_mutex_unlock(parent);
|
|
|
9a499a |
+ if (status)
|
|
|
9a499a |
master_source_unlock(parent->entry);
|
|
|
9a499a |
- }
|
|
|
9a499a |
|
|
|
9a499a |
done:
|
|
|
9a499a |
if (status && status != EBUSY) {
|
|
|
9a499a |
@@ -1809,7 +1804,6 @@ static void submount_source_unlock_neste
|
|
|
9a499a |
struct autofs_point *parent = ap->parent;
|
|
|
9a499a |
|
|
|
9a499a |
master_source_unlock(ap->entry);
|
|
|
9a499a |
- mounts_mutex_unlock(parent);
|
|
|
9a499a |
master_source_unlock(parent->entry);
|
|
|
9a499a |
}
|
|
|
9a499a |
|
|
|
9a499a |
--- autofs-5.1.4.orig/daemon/master.c
|
|
|
9a499a |
+++ autofs-5.1.4/daemon/master.c
|
|
|
9a499a |
@@ -69,7 +69,6 @@ int master_add_autofs_point(struct maste
|
|
|
9a499a |
unsigned nobind, unsigned ghost, int submount)
|
|
|
9a499a |
{
|
|
|
9a499a |
struct autofs_point *ap;
|
|
|
9a499a |
- int status;
|
|
|
9a499a |
|
|
|
9a499a |
ap = malloc(sizeof(struct autofs_point));
|
|
|
9a499a |
if (!ap)
|
|
|
9a499a |
@@ -128,12 +127,6 @@ int master_add_autofs_point(struct maste
|
|
|
9a499a |
INIT_LIST_HEAD(&ap->amdmounts);
|
|
|
9a499a |
ap->shutdown = 0;
|
|
|
9a499a |
|
|
|
9a499a |
- status = pthread_mutex_init(&ap->mounts_mutex, NULL);
|
|
|
9a499a |
- if (status) {
|
|
|
9a499a |
- free(ap->path);
|
|
|
9a499a |
- free(ap);
|
|
|
9a499a |
- return 0;
|
|
|
9a499a |
- }
|
|
|
9a499a |
ap->mode = 0;
|
|
|
9a499a |
|
|
|
9a499a |
entry->ap = ap;
|
|
|
9a499a |
@@ -143,17 +136,11 @@ int master_add_autofs_point(struct maste
|
|
|
9a499a |
|
|
|
9a499a |
void master_free_autofs_point(struct autofs_point *ap)
|
|
|
9a499a |
{
|
|
|
9a499a |
- int status;
|
|
|
9a499a |
-
|
|
|
9a499a |
if (!ap)
|
|
|
9a499a |
return;
|
|
|
9a499a |
|
|
|
9a499a |
mnts_remove_amdmounts(ap);
|
|
|
9a499a |
|
|
|
9a499a |
- status = pthread_mutex_destroy(&ap->mounts_mutex);
|
|
|
9a499a |
- if (status)
|
|
|
9a499a |
- fatal(status);
|
|
|
9a499a |
-
|
|
|
9a499a |
if (ap->pref)
|
|
|
9a499a |
free(ap->pref);
|
|
|
9a499a |
free(ap->path);
|
|
|
9a499a |
--- autofs-5.1.4.orig/include/automount.h
|
|
|
9a499a |
+++ autofs-5.1.4/include/automount.h
|
|
|
9a499a |
@@ -564,7 +564,6 @@ struct autofs_point {
|
|
|
9a499a |
enum states state; /* Current state */
|
|
|
9a499a |
int state_pipe[2]; /* State change router pipe */
|
|
|
9a499a |
struct autofs_point *parent; /* Owner of mounts list for submount */
|
|
|
9a499a |
- pthread_mutex_t mounts_mutex; /* Protect mount lists */
|
|
|
9a499a |
struct list_head mounts; /* List of autofs mounts at current level */
|
|
|
9a499a |
unsigned int submount; /* Is this a submount */
|
|
|
9a499a |
unsigned int submnt_count; /* Number of submounts */
|
|
|
9a499a |
--- autofs-5.1.4.orig/modules/mount_autofs.c
|
|
|
9a499a |
+++ autofs-5.1.4/modules/mount_autofs.c
|
|
|
9a499a |
@@ -283,8 +283,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
set_exp_timeout(nap, NULL, timeout);
|
|
|
9a499a |
nap->exp_runfreq = (timeout + CHECK_RATIO - 1) / CHECK_RATIO;
|
|
|
9a499a |
|
|
|
9a499a |
- mounts_mutex_lock(ap);
|
|
|
9a499a |
-
|
|
|
9a499a |
if (source->flags & MAP_FLAG_FORMAT_AMD) {
|
|
|
9a499a |
struct mnt_list *mnt;
|
|
|
9a499a |
|
|
|
9a499a |
@@ -305,7 +303,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
if (handle_mounts_startup_cond_init(&suc)) {
|
|
|
9a499a |
crit(ap->logopt, MODPREFIX
|
|
|
9a499a |
"failed to init startup cond for mount %s", entry->path);
|
|
|
9a499a |
- mounts_mutex_unlock(ap);
|
|
|
9a499a |
master_free_map_source(source, 1);
|
|
|
9a499a |
master_free_mapent(entry);
|
|
|
9a499a |
return 1;
|
|
|
9a499a |
@@ -316,7 +313,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
crit(ap->logopt,
|
|
|
9a499a |
MODPREFIX "failed to allocate mount %s", realpath);
|
|
|
9a499a |
handle_mounts_startup_cond_destroy(&suc);
|
|
|
9a499a |
- mounts_mutex_unlock(ap);
|
|
|
9a499a |
master_free_map_source(source, 1);
|
|
|
9a499a |
master_free_mapent(entry);
|
|
|
9a499a |
return 1;
|
|
|
9a499a |
@@ -335,7 +331,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
realpath);
|
|
|
9a499a |
handle_mounts_startup_cond_destroy(&suc);
|
|
|
9a499a |
mnts_remove_submount(nap->path);
|
|
|
9a499a |
- mounts_mutex_unlock(ap);
|
|
|
9a499a |
master_free_map_source(source, 1);
|
|
|
9a499a |
master_free_mapent(entry);
|
|
|
9a499a |
return 1;
|
|
|
9a499a |
@@ -346,7 +341,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
if (status) {
|
|
|
9a499a |
handle_mounts_startup_cond_destroy(&suc);
|
|
|
9a499a |
mnts_remove_submount(nap->path);
|
|
|
9a499a |
- mounts_mutex_unlock(ap);
|
|
|
9a499a |
master_free_map_source(source, 1);
|
|
|
9a499a |
master_free_mapent(entry);
|
|
|
9a499a |
fatal(status);
|
|
|
9a499a |
@@ -358,7 +352,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
MODPREFIX "failed to create submount for %s", realpath);
|
|
|
9a499a |
handle_mounts_startup_cond_destroy(&suc);
|
|
|
9a499a |
mnts_remove_submount(nap->path);
|
|
|
9a499a |
- mounts_mutex_unlock(ap);
|
|
|
9a499a |
master_free_map_source(source, 1);
|
|
|
9a499a |
master_free_mapent(entry);
|
|
|
9a499a |
return 1;
|
|
|
9a499a |
@@ -368,7 +361,6 @@ int mount_mount(struct autofs_point *ap,
|
|
|
9a499a |
ap->submnt_count++;
|
|
|
9a499a |
|
|
|
9a499a |
handle_mounts_startup_cond_destroy(&suc);
|
|
|
9a499a |
- mounts_mutex_unlock(ap);
|
|
|
9a499a |
|
|
|
9a499a |
return 0;
|
|
|
9a499a |
}
|