]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Filer: make layout pointer const
authorYan, Zheng <zyan@redhat.com>
Tue, 3 Jul 2018 11:56:31 +0000 (19:56 +0800)
committerYan, Zheng <zyan@redhat.com>
Mon, 20 Jul 2020 03:22:37 +0000 (11:22 +0800)
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
src/osdc/Filer.cc
src/osdc/Filer.h

index 8d2111fb93dc4c902d65dc9f2e47cc6c065ef9af..0b12df1a4fc654e9011984208e33d8df55444185 100644 (file)
@@ -71,7 +71,7 @@ public:
 };
 
 int Filer::probe(inodeno_t ino,
-                file_layout_t *layout,
+                const file_layout_t *layout,
                 snapid_t snapid,
                 uint64_t start_from,
                 uint64_t *end, // LB, when !fwd
@@ -94,7 +94,7 @@ int Filer::probe(inodeno_t ino,
 }
 
 int Filer::probe(inodeno_t ino,
-                file_layout_t *layout,
+                const file_layout_t *layout,
                 snapid_t snapid,
                 uint64_t start_from,
                 uint64_t *end, // LB, when !fwd
@@ -115,7 +115,7 @@ int Filer::probe(inodeno_t ino,
   return probe_impl(probe, layout, start_from, end);
 }
 
-int Filer::probe_impl(Probe* probe, file_layout_t *layout,
+int Filer::probe_impl(Probe* probe, const file_layout_t *layout,
                      uint64_t start_from, uint64_t *end) // LB, when !fwd
 {
   // period (bytes before we jump unto a new set of object(s))
@@ -404,7 +404,7 @@ struct TruncRange {
 };
 
 void Filer::truncate(inodeno_t ino,
-                    file_layout_t *layout,
+                    const file_layout_t *layout,
                     const SnapContext& snapc,
                     uint64_t offset,
                     uint64_t len,
index cedb710c234584c3167a2f1b762b4e3f4031cfba..42cf9e99868c7e9dc9dcf3d7c5c646503f5df52e 100644 (file)
@@ -80,7 +80,7 @@ class Filer {
     int err;
     bool found_size;
 
-    Probe(inodeno_t i, file_layout_t &l, snapid_t sn,
+    Probe(inodeno_t i, const file_layout_t &l, snapid_t sn,
          uint64_t f, uint64_t *e, ceph::real_time *m, int fl, bool fw,
          Context *c) :
       ino(i), layout(l), snapid(sn),
@@ -88,7 +88,7 @@ class Filer {
       probing_off(f), probing_len(0),
       err(0), found_size(false) {}
 
-    Probe(inodeno_t i, file_layout_t &l, snapid_t sn,
+    Probe(inodeno_t i, const file_layout_t &l, snapid_t sn,
          uint64_t f, uint64_t *e, utime_t *m, int fl, bool fw,
          Context *c) :
       ino(i), layout(l), snapid(sn),
@@ -118,7 +118,7 @@ class Filer {
   /*** async file interface.  scatter/gather as needed. ***/
 
   void read(inodeno_t ino,
-          file_layout_t *layout,
+          const file_layout_t *layout,
           snapid_t snap,
           uint64_t offset,
           uint64_t len,
@@ -133,7 +133,7 @@ class Filer {
   }
 
   void read_trunc(inodeno_t ino,
-                file_layout_t *layout,
+                const file_layout_t *layout,
                 snapid_t snap,
                 uint64_t offset,
                 uint64_t len,
@@ -152,7 +152,7 @@ class Filer {
   }
 
   void write(inodeno_t ino,
-           file_layout_t *layout,
+           const file_layout_t *layout,
            const SnapContext& snapc,
            uint64_t offset,
            uint64_t len,
@@ -167,7 +167,7 @@ class Filer {
   }
 
   void write_trunc(inodeno_t ino,
-                 file_layout_t *layout,
+                 const file_layout_t *layout,
                  const SnapContext& snapc,
                  uint64_t offset,
                  uint64_t len,
@@ -186,7 +186,7 @@ class Filer {
   }
 
   void truncate(inodeno_t ino,
-              file_layout_t *layout,
+              const file_layout_t *layout,
               const SnapContext& snapc,
               uint64_t offset,
               uint64_t len,
@@ -233,7 +233,7 @@ class Filer {
   }
 
   void zero(inodeno_t ino,
-          file_layout_t *layout,
+          const file_layout_t *layout,
           const SnapContext& snapc,
           uint64_t offset,
           uint64_t len,
@@ -261,7 +261,7 @@ class Filer {
    *  and whether we stop when we find data, or hole.
    */
   int probe(inodeno_t ino,
-           file_layout_t *layout,
+           const file_layout_t *layout,
            snapid_t snapid,
            uint64_t start_from,
            uint64_t *end,
@@ -271,7 +271,7 @@ class Filer {
            Context *onfinish);
 
   int probe(inodeno_t ino,
-           file_layout_t *layout,
+           const file_layout_t *layout,
            snapid_t snapid,
            uint64_t start_from,
            uint64_t *end,
@@ -283,7 +283,7 @@ class Filer {
   }
 
   int probe(inodeno_t ino,
-           file_layout_t *layout,
+           const file_layout_t *layout,
            snapid_t snapid,
            uint64_t start_from,
            uint64_t *end,
@@ -293,7 +293,7 @@ class Filer {
            Context *onfinish);
 
 private:
-  int probe_impl(Probe* probe, file_layout_t *layout,
+  int probe_impl(Probe* probe, const file_layout_t *layout,
                 uint64_t start_from, uint64_t *end);
 };