[PATCH 05/24] Change 'mode' attribute to 'buffered_mode'

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

 



Instead of returning 'buffered' or 'synchronous', returns True if
buffered, else False. This helps it line up better with the buffered_mode
param to the FileIOStorageObject ctor.

Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
---
 rtslib/tcm.py |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/rtslib/tcm.py b/rtslib/tcm.py
index 12ab4dc..c363b2e 100644
--- a/rtslib/tcm.py
+++ b/rtslib/tcm.py
@@ -843,9 +843,12 @@ class FileIOStorageObject(StorageObject):
             wwn = generate_wwn('unit_serial')
         self.wwn = wwn
 
-    def _get_mode(self):
+    def _get_buffered_mode(self):
         self._check_self()
-        return self._parse_info('Mode')
+        if self._parse_info('Mode') == 'buffered':
+            return True
+        else:
+            return False
 
     def _get_size(self):
         self._check_self()
@@ -864,8 +867,8 @@ class FileIOStorageObject(StorageObject):
 
     # FileIOStorageObject public stuff
 
-    mode = property(_get_mode,
-            doc="Get the current FileIOStorage mode, buffered or synchronous")
+    buffered_mode = property(_get_buffered_mode,
+            doc="True if buffered, False if synchronous (O_SYNC)")
     size = property(_get_size,
             doc="Get the current FileIOStorage size in bytes")
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux