[haiku-commits] r37506 - haiku/trunk/src/tests/system/kernel/file_corruption/fs

  • From: ingo_weinhold@xxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 14 Jul 2010 02:04:43 +0200 (CEST)

Author: bonefish
Date: 2010-07-14 02:04:43 +0200 (Wed, 14 Jul 2010)
New Revision: 37506
Changeset: http://dev.haiku-os.org/changeset/37506

Modified:
   haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.cpp
   haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.h
Log:
* Added some stat data setters.
* Added virtual methods needed for files.


Modified: haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.cpp
===================================================================
--- haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.cpp     
2010-07-14 00:03:42 UTC (rev 37505)
+++ haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.cpp     
2010-07-14 00:04:43 UTC (rev 37506)
@@ -11,6 +11,7 @@
 #include <unistd.h>
 
 #include "Block.h"
+#include "DebugSupport.h"
 
 
 static inline uint64
@@ -69,6 +70,41 @@
 }
 
 
+status_t
+Node::InitForVFS()
+{
+       return B_OK;
+}
+
+
+status_t
+Node::DeletingNode(Transaction& transaction)
+{
+       return B_OK;
+}
+
+
+status_t
+Node::Resize(uint64 newSize, bool fillWithZeroes, Transaction& transaction)
+{
+       RETURN_ERROR(B_BAD_VALUE);
+}
+
+
+status_t
+Node::Read(off_t pos, void* buffer, size_t size, size_t& _bytesRead)
+{
+       RETURN_ERROR(B_BAD_VALUE);
+}
+
+
+status_t
+Node::Write(off_t pos, const void* buffer, size_t size, size_t& _bytesWritten)
+{
+       RETURN_ERROR(B_BAD_VALUE);
+}
+
+
 void
 Node::SetParentDirectory(uint32 blockIndex)
 {
@@ -86,13 +122,61 @@
 
 
 void
+Node::SetUID(uint32 uid)
+{
+       fNode.uid = uid;
+       fNodeDataDirty = true;
+}
+
+
+void
+Node::SetGID(uint32 gid)
+{
+       fNode.gid = gid;
+       fNodeDataDirty = true;
+}
+
+
+void
 Node::SetSize(uint64 size)
 {
        fNode.size = size;
+       fNodeDataDirty = true;
 }
 
 
 void
+Node::SetAccessedTime(uint64 time)
+{
+       fAccessedTime = time;
+}
+
+
+void
+Node::SetCreationTime(uint64 time)
+{
+       fNode.creationTime = time;
+       fNodeDataDirty = true;
+}
+
+
+void
+Node::SetModificationTime(uint64 time)
+{
+       fNode.modificationTime = time;
+       fNodeDataDirty = true;
+}
+
+
+void
+Node::SetChangeTime(uint64 time)
+{
+       fNode.changeTime = time;
+       fNodeDataDirty = true;
+}
+
+
+void
 Node::Touched(int32 mode)
 {
        fAccessedTime = current_time_nanos();

Modified: haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.h
===================================================================
--- haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.h       
2010-07-14 00:03:42 UTC (rev 37505)
+++ haiku/trunk/src/tests/system/kernel/file_corruption/fs/Node.h       
2010-07-14 00:04:43 UTC (rev 37506)
@@ -34,6 +34,16 @@
                                                                        mode_t 
mode);
        virtual                                         ~Node();
 
+       virtual status_t                        InitForVFS();
+       virtual status_t                        DeletingNode(Transaction& 
transaction);
+
+       virtual status_t                        Resize(uint64 newSize, bool 
fillWithZeroes,
+                                                                       
Transaction& transaction);
+       virtual status_t                        Read(off_t pos, void* buffer, 
size_t size,
+                                                                       size_t& 
_bytesRead);
+       virtual status_t                        Write(off_t pos, const void* 
buffer,
+                                                                       size_t 
size, size_t& _bytesWritten);
+
        inline  const checksumfs_node& NodeData() const { return fNode; }
        inline  Volume*                         GetVolume() const       { 
return fVolume; }
        inline  uint64                          BlockIndex() const      { 
return fBlockIndex; }
@@ -50,7 +60,13 @@
 
                        void                            
SetParentDirectory(uint32 blockIndex);
                        void                            SetHardLinks(uint32 
value);
+                       void                            SetUID(uint32 uid);
+                       void                            SetGID(uint32 gid);
                        void                            SetSize(uint64 size);
+                       void                            SetAccessedTime(uint64 
time);
+                       void                            SetCreationTime(uint64 
time);
+                       void                            
SetModificationTime(uint64 time);
+                       void                            SetChangeTime(uint64 
time);
 
                        void                            Touched(int32 mode);
 
@@ -59,7 +75,7 @@
        inline  bool                            WriteLock();
        inline  void                            WriteUnlock();
 
-                       void                            RevertNodeData(const 
checksumfs_node& nodeData);
+       virtual void                            RevertNodeData(const 
checksumfs_node& nodeData);
 
                        status_t                        Flush(Transaction& 
transaction);
 


Other related posts:

  • » [haiku-commits] r37506 - haiku/trunk/src/tests/system/kernel/file_corruption/fs - ingo_weinhold