emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r107442: * net/tramp.el (tramp-inodes


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r107442: * net/tramp.el (tramp-inodes, tramp-devices): Initialize with 0.
Date: Sun, 26 Feb 2012 20:36:59 +0100
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 107442
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Sun 2012-02-26 20:36:59 +0100
message:
  * net/tramp.el (tramp-inodes, tramp-devices): Initialize with 0.
  (tramp-get-inode, tramp-get-device): Use cached values.
modified:
  lisp/ChangeLog
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-02-26 13:02:52 +0000
+++ b/lisp/ChangeLog    2012-02-26 19:36:59 +0000
@@ -1,3 +1,8 @@
+2012-02-26  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-inodes, tramp-devices): Initialize with 0.
+       (tramp-get-inode, tramp-get-device): Use cached values.
+
 2012-02-26  Alan Mackenzie  <address@hidden>
 
        Check there is a font-lock specification before doing initial

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2012-02-25 08:51:32 +0000
+++ b/lisp/net/tramp.el 2012-02-26 19:36:59 +0000
@@ -1650,7 +1650,7 @@
 ;; applied might be not so efficient (Ange-FTP uses hashes). But
 ;; performance isn't the major issue given that file transfer will
 ;; take time.
-(defvar tramp-inodes nil
+(defvar tramp-inodes 0
   "Keeps virtual inodes numbers.")
 
 ;; Devices must distinguish physical file systems.  The device numbers
@@ -1658,7 +1658,7 @@
 ;; So we use virtual device numbers, generated by Tramp.  Both Ange-FTP and
 ;; EFS use device number "-1".  In order to be different, we use device number
 ;; (-1 . x), whereby "x" is unique for a given (method user host).
-(defvar tramp-devices nil
+(defvar tramp-devices 0
   "Keeps virtual device numbers.")
 
 (defun tramp-default-file-modes (filename)
@@ -3412,28 +3412,14 @@
 (defun tramp-get-inode (vec)
   "Returns the virtual inode number.
 If it doesn't exist, generate a new one."
-  (let ((string (tramp-make-tramp-file-name
-                (tramp-file-name-method vec)
-                (tramp-file-name-user vec)
-                (tramp-file-name-host vec)
-                "")))
-    (unless (assoc string tramp-inodes)
-      (add-to-list 'tramp-inodes
-                  (list string (length tramp-inodes))))
-    (nth 1 (assoc string tramp-inodes))))
+  (with-file-property vec (tramp-file-name-localname vec) "inode"
+    (setq tramp-inodes (1+ tramp-inodes))))
 
 (defun tramp-get-device (vec)
   "Returns the virtual device number.
 If it doesn't exist, generate a new one."
-  (let ((string (tramp-make-tramp-file-name
-                (tramp-file-name-method vec)
-                (tramp-file-name-user vec)
-                (tramp-file-name-host vec)
-                "")))
-    (unless (assoc string tramp-devices)
-      (add-to-list 'tramp-devices
-                  (list string (length tramp-devices))))
-    (cons -1 (nth 1 (assoc string tramp-devices)))))
+  (with-connection-property (tramp-get-connection-process vec) "device"
+    (cons -1 (setq tramp-devices (1+ tramp-devices)))))
 
 (defun tramp-equal-remote (file1 file2)
   "Check, whether the remote parts of FILE1 and FILE2 are identical.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]