[prev in list] [next in list] [prev in thread] [next in thread] 

List:       helix-server-cvs
Subject:    [Server-cvs] engine/dataflow fastfile.cpp,1.12,1.12.2.1
From:       jzeng () helixcommunity ! org
Date:       2011-01-31 22:10:33
Message-ID: 201101312210.p0VMAKwu031795 () mailer ! progressive-comp ! com
[Download RAW message or body]

Update of /cvsroot/server/engine/dataflow
In directory cvs01.internal.helixcommunity.org:/tmp/cvs-serv13934/server/engine/dataflow

Modified Files:
      Tag: SERVER_14_2
	fastfile.cpp 
Log Message:
Synopsis
============
Bug 269302:  asyncfs not working with large files on win64
Branches:  head, server_14_2
Suggested Reviewer: Dean

Description
=========== 

There are two bugs:

1. On win64, stat() will fail on large file.  We need to use _stat64()  instead.  This involves the
fix on asyncfs, as well as changing the interface IHXStat2Response to use HXSTAT instead of "struct
stat".

2. A weird bug in fastfile.  On linux it works okay(or it doesn't get called).  But on win64

m_nStartReadPos &= ~(m_ulSectorAlignment - 1);

will chop off the higher 32 bit of m_nStartReadPos.

This fix is to make m_ulSectorAlignment HX_OFF_T.

Files Affected
==============
common/include/hxfiles.h,v
server/broadcast/transport/rtp/recv/qtdirmgr.cpp,v
server/broadcast/transport/rtp/recv/qtdirmgr.h,v
server/engine/dataflow/fastfile.cpp,v
server/engine/dataflow/pub/fastfile.h,v
server/fs/asncfs/asncfobj.cpp,v
server/fs/asncfs/asncfobj.h,v

Testing Performed
================= 

Unit Tests: 
None. 

Integration Tests: 
verify asyncfs works on both win64 and rhel5 with large files.

Leak Tests: 
None. 

Performance Tests: 
- None 

Platforms Tested: win-x86_64-vc10
Build verified: win-x86_64-vc10 






Index: fastfile.cpp
===================================================================
RCS file: /cvsroot/server/engine/dataflow/fastfile.cpp,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- fastfile.cpp	15 Nov 2010 16:45:33 -0000	1.12
+++ fastfile.cpp	31 Jan 2011 22:10:31 -0000	1.12.2.1
@@ -327,7 +327,7 @@
     , m_pAlignmentReadBuf(0)
     , m_ulChunkSize(0)
     , m_ulMaxAddressSpaceUsed(0)
-    , m_ulSectorAlignment(0)
+    , m_nSectorAlignment(0)
     , m_nStartReadPos(0)
 {
     xprintf (("%p: FastFile::FastFile create pUnk=%p pURL=%s\n",
@@ -352,7 +352,7 @@
         pUnk->QueryInterface(IID_IHXFilePlacementRead,
                              (void**)&m_pFileObjectPlacementRead) == HXR_OK)
     {
-        m_ulSectorAlignment = m_pFileObjectPlacementRead->AlignmentBoundary();
+        m_nSectorAlignment = m_pFileObjectPlacementRead->AlignmentBoundary();
         m_bAlignReads = TRUE;
     }
 
@@ -808,9 +808,9 @@
     {
         // if we need to align the start read position on a sector boundary,
         // then do so
-        if (m_ulSectorAlignment)
+        if (m_nSectorAlignment)
         {
-            m_nStartReadPos &= ~(m_ulSectorAlignment - 1);
+            m_nStartReadPos &= ~(m_nSectorAlignment - 1);
         }
 
         // create a read size that will leave the file in an aligned
@@ -873,9 +873,9 @@
             // on linux we need to align the memory buffer in addition
             // to what we've done above
             m_pAlignmentReadBuf = (char*)m_pIMalloc->Alloc(
-                m_ulAlignmentReadAmount + m_ulSectorAlignment);
+                m_ulAlignmentReadAmount + m_nSectorAlignment);
             m_nAlignmentReadOffset = (((size_t)m_pAlignmentReadBuf |
-                ((size_t)m_ulSectorAlignment - 1)) + 1) - (size_t)m_pAlignmentReadBuf;
+                ((size_t)m_nSectorAlignment - 1)) + 1) - (size_t)m_pAlignmentReadBuf;
 #    else
             m_pAlignmentReadBuf = 0;
             m_nAlignmentReadOffset = 0;
@@ -956,6 +956,7 @@
 {
     xprintf (("%p: FastFile::Seek offset=%lu %s\n", this, nOffset,
               bRelative ? "(relative)" : "(absolute)"));
+
     if (!m_pRealResponse)
     {
 	return HXR_UNEXPECTED;


_______________________________________________
Server-cvs mailing list
Server-cvs@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/server-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic