summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-cache.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2021-10-03 18:55:35 +0200
committerMichael Albinus <michael.albinus@gmx.de>2021-10-03 18:55:35 +0200
commit3863919a00e5f6c7cf9d4fe9e1b1a96fd5c18173 (patch)
treed8a1987e34baa0e6eb6ccc5015cc865550850962 /lisp/net/tramp-cache.el
parent7a6d34cd1f1ea2eb053578521632420d6ff9c0db (diff)
downloademacs-3863919a00e5f6c7cf9d4fe9e1b1a96fd5c18173.tar.gz
emacs-3863919a00e5f6c7cf9d4fe9e1b1a96fd5c18173.tar.bz2
emacs-3863919a00e5f6c7cf9d4fe9e1b1a96fd5c18173.zip
Fix unmounting in Tramp
* doc/misc/tramp.texi (FUSE setup): Add tramp-fuse-unmount-on-cleanup. * lisp/net/tramp.el (tramp-file-name-unify): New defun. (tramp-file-name-equal-p): * lisp/net/tramp-cache.el (tramp-get-connection-property) (tramp-set-connection-property, tramp-flush-connection-property) (tramp-flush-connection-properties): Use it. * lisp/net/tramp-fuse.el (tramp-fuse-get-fusermount): New defun. (tramp-fuse-mount-points): New defvar. (tramp-fuse-unmount): Use it. Delete VEC from `tramp-fuse-mount-points'. Delete mount point. (tramp-fuse-unmount-on-cleanup): New user option. (tramp-fuse-cleanup, tramp-fuse-cleanup-all): New defuns. (top): Adapt `tramp-fuse-unload-hook', `tramp-cleanup-connection-hook', `tramp-cleanup-all-connections-hook' and `kill-emacs-hook'. * lisp/net/tramp-rclone.el (tramp-rclone-maybe-open-connection): * lisp/net/tramp-sshfs.el (tramp-sshfs-maybe-open-connection): Add VEC to `tramp-fuse-mount-points'. * test/lisp/net/tramp-tests.el (tramp-fuse-unmount-on-cleanup): Declare. (tramp-test39-make-lock-file-name): Use it.
Diffstat (limited to 'lisp/net/tramp-cache.el')
-rw-r--r--lisp/net/tramp-cache.el28
1 files changed, 4 insertions, 24 deletions
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 5a00915f4f0..f1c656ec209 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -319,12 +319,7 @@ KEY identifies the connection, it is either a process or a
used to cache connection properties of the local machine.
If KEY is `tramp-cache-undefined', or if the value is not set for
the connection, return DEFAULT."
- ;; Unify key by removing localname and hop from `tramp-file-name'
- ;; structure. Work with a copy in order to avoid side effects.
- (when (tramp-file-name-p key)
- (setq key (copy-tramp-file-name key))
- (setf (tramp-file-name-localname key) nil
- (tramp-file-name-hop key) nil))
+ (setq key (tramp-file-name-unify key))
(let* ((hash (tramp-get-hash-table key))
(cached (if (hash-table-p hash)
(gethash property hash tramp-cache-undefined)
@@ -350,12 +345,7 @@ used to cache connection properties of the local machine. If KEY
is `tramp-cache-undefined', nothing is set.
PROPERTY is set persistent when KEY is a `tramp-file-name' structure.
Return VALUE."
- ;; Unify key by removing localname and hop from `tramp-file-name'
- ;; structure. Work with a copy in order to avoid side effects.
- (when (tramp-file-name-p key)
- (setq key (copy-tramp-file-name key))
- (setf (tramp-file-name-localname key) nil
- (tramp-file-name-hop key) nil))
+ (setq key (tramp-file-name-unify key))
(when-let ((hash (tramp-get-hash-table key)))
(puthash property value hash))
(setq tramp-cache-data-changed
@@ -379,12 +369,7 @@ KEY identifies the connection, it is either a process or a
`tramp-file-name' structure. A special case is nil, which is
used to cache connection properties of the local machine.
PROPERTY is set persistent when KEY is a `tramp-file-name' structure."
- ;; Unify key by removing localname and hop from `tramp-file-name'
- ;; structure. Work with a copy in order to avoid side effects.
- (when (tramp-file-name-p key)
- (setq key (copy-tramp-file-name key))
- (setf (tramp-file-name-localname key) nil
- (tramp-file-name-hop key) nil))
+ (setq key (tramp-file-name-unify key))
(when-let ((hash (tramp-get-hash-table key)))
(remhash property hash))
(setq tramp-cache-data-changed
@@ -397,12 +382,7 @@ PROPERTY is set persistent when KEY is a `tramp-file-name' structure."
KEY identifies the connection, it is either a process or a
`tramp-file-name' structure. A special case is nil, which is
used to cache connection properties of the local machine."
- ;; Unify key by removing localname and hop from `tramp-file-name'
- ;; structure. Work with a copy in order to avoid side effects.
- (when (tramp-file-name-p key)
- (setq key (copy-tramp-file-name key))
- (setf (tramp-file-name-localname key) nil
- (tramp-file-name-hop key) nil))
+ (setq key (tramp-file-name-unify key))
(tramp-message
key 7 "%s %s" key
(when-let ((hash (gethash key tramp-cache-data)))