~ubuntu-branches/ubuntu/quantal/ceph/quantal

« back to all changes in this revision

Viewing changes to src/cls_rbd.cc

  • Committer: Bazaar Package Importer
  • Author(s): Clint Byrum, Clint Byrum, Micah Gersten
  • Date: 2011-02-12 22:50:26 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20110212225026-yyyw4tk0msgql3ul
Tags: 0.24.2-0ubuntu1
[ Clint Byrum <clint@ubuntu.com> ]
* New upstream release. (LP: #658670, LP: #684011)
* debian/patches/fix-mkcephfs.patch: dropped (applied upstream)
* Removed .la files from libceph1-dev, libcrush1-dev and 
  librados1-dev (per Debian policy v3.9.1 10.2).
* debian/control: adding pkg-config as a build dependency
* debian/control: depend on libcrypto++-dev instead of libssl-dev
* debian/watch: added watch file

[ Micah Gersten <micahg@ubuntu.com> ]
* debian/control: add Homepage

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
#include "include/rbd_types.h"
13
13
 
14
 
CLS_VER(1,2)
 
14
CLS_VER(1,3)
15
15
CLS_NAME(rbd)
16
16
 
17
17
cls_handle_t h_class;
115
115
  try {
116
116
    ::decode(s, iter);
117
117
    ::decode(snap_id, iter);
118
 
  } catch (buffer::error *err) {
 
118
  } catch (const buffer::error &err) {
119
119
    return -EINVAL;
120
120
  }
121
121
  snap_name = s.c_str();
192
192
 
193
193
  try {
194
194
    ::decode(s, iter);
195
 
  } catch (buffer::error *err) {
 
195
  } catch (const buffer::error &err) {
196
196
    return -EINVAL;
197
197
  }
198
198
  snap_name = s.c_str();
267
267
 
268
268
  try {
269
269
    ::decode(s, iter);
270
 
  } catch (buffer::error *err) {
 
270
  } catch (const buffer::error &err) {
271
271
    return -EINVAL;
272
272
  }
273
273
  snap_name = s.c_str();
285
285
    return -ENOENT;
286
286
  }
287
287
 
288
 
  snap_names += s.length() + 1;
289
 
 
290
288
  header->snap_names_len  = header->snap_names_len - (s.length() + 1);
291
289
  header->snap_count = header->snap_count - 1;
292
290
 
297
295
  newbl.push_back(header_bp);
298
296
 
299
297
  if (header->snap_count) {
 
298
    int snaps_len = 0;
 
299
    int names_len = 0;
 
300
    CLS_LOG("i=%d\n", i);
300
301
    if (i > 0) {
301
 
      memcpy(new_snaps_bp.c_str(), header->snaps, sizeof(header->snaps[0]) * i);
302
 
      memcpy(new_names_bp.c_str(), header->snaps, snap_names - orig_names);
 
302
      snaps_len = sizeof(header->snaps[0]) * i;
 
303
      names_len =  snap_names - orig_names;
 
304
      memcpy(new_snaps_bp.c_str(), header->snaps, snaps_len);
 
305
      memcpy(new_names_bp.c_str(), orig_names, names_len);
303
306
    }
304
307
    snap_names += s.length() + 1;
305
308
 
306
309
    if (i < header->snap_count) {
307
 
      memcpy(new_snaps_bp.c_str(), header->snaps, sizeof(header->snaps[0]) * i);
308
 
      memcpy(new_names_bp.c_str(), snap_names , end - snap_names);
 
310
      memcpy(new_snaps_bp.c_str() + snaps_len,
 
311
             header->snaps + i + 1,
 
312
             sizeof(header->snaps[0]) * (header->snap_count - i));
 
313
      memcpy(new_names_bp.c_str() + names_len, snap_names , end - snap_names);
309
314
    }
 
315
    newbl.push_back(new_snaps_bp);
 
316
    newbl.push_back(new_names_bp);
310
317
  }
311
318
 
312
319
  rc = cls_cxx_write_full(hctx, &newbl);