[CalendarServer-changes] [4550] CalendarServer/branches/users/wsanchez/deployment/lib-patches/ Twisted

source_changes at macosforge.org source_changes at macosforge.org
Wed Sep 23 07:17:34 PDT 2009


Revision: 4550
          http://trac.macosforge.org/projects/calendarserver/changeset/4550
Author:   cdaboo at apple.com
Date:     2009-09-23 07:17:30 -0700 (Wed, 23 Sep 2009)
Log Message:
-----------
(Missed from last commit) Reduce number of file systems stats.

Added Paths:
-----------
    CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.python.filepath.patch
    CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.web2.dav.fileop.patch

Added: CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.python.filepath.patch
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.python.filepath.patch	                        (rev 0)
+++ CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.python.filepath.patch	2009-09-23 14:17:30 UTC (rev 4550)
@@ -0,0 +1,32 @@
+Index: twisted/python/filepath.py
+===================================================================
+--- twisted/python/filepath.py	(revision 19773)
++++ twisted/python/filepath.py	(working copy)
+@@ -370,6 +370,9 @@
+ 
+     # stat methods below
+ 
++    def changed(self):
++        self.statinfo = None
++
+     def restat(self, reraise=True):
+         """
+         Re-calculate cached effects of 'stat'.  To refresh information on this path
+@@ -496,7 +499,7 @@
+             os.rmdir(self.path)
+         else:
+             os.remove(self.path)
+-        self.restat(False)
++        self.changed()
+ 
+     def makedirs(self):
+         return os.makedirs(self.path)
+@@ -600,7 +603,7 @@
+     def moveTo(self, destination):
+         try:
+             os.rename(self.path, destination.path)
+-            self.restat(False)
++            self.changed()
+         except OSError, ose:
+             if ose.errno == errno.EXDEV:
+                 # man 2 rename, ubuntu linux 5.10 "breezy":

Added: CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.web2.dav.fileop.patch
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.web2.dav.fileop.patch	                        (rev 0)
+++ CalendarServer/branches/users/wsanchez/deployment/lib-patches/Twisted/twisted.web2.dav.fileop.patch	2009-09-23 14:17:30 UTC (rev 4550)
@@ -0,0 +1,48 @@
+Index: twisted/web2/dav/fileop.py
+===================================================================
+--- twisted/web2/dav/fileop.py	(revision 19773)
++++ twisted/web2/dav/fileop.py	(working copy)
+@@ -161,8 +161,8 @@
+ 
+         response = responsecode.NO_CONTENT
+ 
+-    # Restat filepath since we deleted the backing file
+-    filepath.restat(False)
++    # Remove stat info for filepath since we deleted the backing file
++    filepath.changed()
+ 
+     return succeed(response)
+ 
+@@ -372,8 +372,8 @@
+     except OSError:
+         pass
+     else:
+-        # Restat source filepath since we moved it
+-        source_filepath.restat(False)
++        # Remove stat info from source filepath since we moved it
++        source_filepath.changed()
+         yield success_code
+         return
+ 
+@@ -463,8 +463,8 @@
+             "writing to file: %s" % (filepath.path,)
+         ))
+ 
+-    # Restat filepath since we modified the backing file
+-    filepath.restat(False)
++    # Remove stat info from filepath since we modified the backing file
++    filepath.changed()
+     yield success_code
+ 
+ put = deferredGenerator(put)
+@@ -481,8 +481,8 @@
+     """
+     try:
+         os.mkdir(filepath.path)
+-        # Restat filepath because we modified it
+-        filepath.restat(False)
++        # Remove stat info from filepath because we modified it
++        filepath.changed()
+     except:
+         raise HTTPError(statusForFailure(
+             Failure(),
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090923/7a4409c1/attachment.html>


More information about the calendarserver-changes mailing list