Commit Graph

35 Commits

Author SHA1 Message Date
Sahithi R V
fa7470a0bb rbd_fuse:replaced pthread_mutex*() functions with ceph Mutex wrapper
Signed-off-by: Sahithi R V <tansy.rv@gmail.com>
2016-01-29 17:15:07 +05:30
Yongqiang He
4275ee66bb rbd-fuse:image name can not include snap name
It is legal to create a image name like "foo@s1" by the rbd-fuse method.However the "foo@s1" type image name is not accepted for it may be wrongly treated as the snap name.

Signed-off-by: Yongqiang He <he.yongqiang@h3c.com>
2015-12-24 05:01:36 -05:00
wuxiangwei
71eb4f9f09 rbd-fuse: discard space restriction for mv operation
discard space restriction for destination image name of
the mv operation.

Signed-off-by: Xiangwei Wu wuxiangwei@h3c.com
2015-12-20 04:14:35 -05:00
wuxiangwei
d13f6024d3 rbd:add destination image name validation for rbd-fuse mv operation
add validation for destination image name to
avoid image name contains invalid characters, such as "/" and "@".

Signed-off-by: Xiangwei Wu wuxiangwei@h3c.com
2015-12-15 22:47:57 -05:00
wuxiangwei
228aedff2a rbd: implement mv operation for rbd-fuse
implement mv operation for rbd-fuse to rename image.

Signed-off-by: Xiangwei Wu wuxiangwei@h3c.com
2015-12-15 07:42:15 -05:00
Yan, Zheng
b4330832cd compat: include proper headers for FreeBSD
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-09-11 17:09:17 +08:00
Yan, Zheng
f6fa4a28d1 compat: move definitions in porting.h into include/compat.h
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:27 +08:00
Yan, Zheng
f064e90ae5 Link ceph-fuse to fuse on DARWIN
Signed-off-by: Yan, Zheng <zyan@redhat.com>
2015-08-31 16:00:22 +08:00
Dennis Schafroth
b3b29c0db0 rbd-fuse: Add position to set/get xattr on DARWIN
Signed-off-by: Dennis Schafroth <dennis@schafroth.com>
2015-08-31 15:35:57 +08:00
Casey Bodley
11a5d29299 c++11: fixes for preprocessor string concatenation
c++11 adds user-defined literals through type suffixes. for example,
"foo"s is a literal of type std::basic_string. this means that any
non-whitespace characters following a string literal will be interpreted
as a suffix. this causes issues with string concatenation done by the
preprocessor, which can only be resolved by adding whitespace

Signed-off-by: Casey Bodley <cbodley@redhat.com>
2015-08-07 11:42:58 -04:00
Loic Dachary
489bca16fb fix a few minor compilation warnings
Signed-off-by: Loic Dachary <ldachary@redhat.com>
2015-03-16 08:13:44 +01:00
Danny Al-Gaaf
64b7c369f9 rbd-fuse.cc: use static_cast instead of c-style cast
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2015-02-03 22:51:08 +01:00
Josh Durgin
4e88414468 rbd-fuse: clean up when shutdown
Close all open images and librados state. This cleans up watches so we
don't need to wait for them to timeout in tests.

rbd-fuse is still a rough prototype, but this makes it slightly more
usable for testing.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
2015-01-24 15:39:20 -08:00
Matt Benjamin
b677a86fb2 Build rbd-fuse as a C++ unit (matching its existing linkage).
Since rbd-fuse is linking C++ libraries, link it with the C++
runtime as we already do for ceph-fuse.

Signed-off-by: Matt Benjamin <matt@cohortfs.com>
2015-01-14 16:40:46 -05:00
Adam Crume
9132ca4795 rbd-fuse: Fix memory leak in enumerate_images
Fixes: #5768
Signed-off-by: Adam Crume <adamcrume@gmail.com>
2014-09-18 14:03:26 -07:00
Daniel J. Hofmann
ba014459ed Fixed missing initializers issues
Signed-off-by: Daniel J. Hofmann <daniel@trvx.org>
2014-05-09 17:25:07 +02:00
Danny Al-Gaaf
569023202b rbd-fuse.c: remove ridiculous linebreak
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 17:08:32 +02:00
Danny Al-Gaaf
7a3724b037 rbd-fuse.c: fix indentation
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 17:05:48 +02:00
Danny Al-Gaaf
8101f980da rbd-fuse.c: fix -Wmissing-field-initializers
Init image_name with NULL to fix:

rbd_fuse/rbd-fuse.c:57:63: warning: missing field 'image_name' initializer
 [-Wmissing-field-initializers]
 struct rbd_options rbd_options = {"/etc/ceph/ceph.conf", "rbd"};

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 16:59:45 +02:00
Danny Al-Gaaf
0d01563f8b rbd-fuse.c: init 'rbd' in open_rbd_image()
Init 'rbd' in open_rbd_image() with NULL and add a check for
'rbd' before dereference it to fix:

rbd_fuse/rbd-fuse.c:182:29: warning: variable 'rbd' may be uninitialized
 when used here [-Wconditional-uninitialized]
        int ret = rbd_open(ioctx, rbd->image_name, &(rbd->image), NULL);
                                  ^~~
rbd_fuse/rbd-fuse.c:151:27: note: initialize the variable 'rbd' to silence
 this warning
        struct rbd_openimage *rbd;
                                 ^
                                  = NULL

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2014-05-08 16:04:18 +02:00
Shawn Edwards
3920f40afc rbd-fuse: fix unlink
The path contains a leading / that needs to be ignored.

Fixes: #8197
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
2014-04-28 17:08:12 -07:00
Stephen F Taylor
b1df2c379b Changed the -i parameter to -r in order to avoid a conflict with a generic flag interpreted by the common code. 2014-04-28 15:31:07 -06:00
Stephen F Taylor
3ec0040699 Added a new command line parameter (-i or --image=) that allows rbd-fuse to specify a single image to be made available within
the mount directory. The purpose of this is to allow a single RBD to be "mounted" in userspace without opening (and locking)
the other RBDs in the pool.

This is accomplished by performing a case-sensitive string compare in enumerate_images() when an image name is
specified on the command line. If no image name is specified, all images appear in the mount directory. If a non-existent
image name is specified, the mount directory is empty.

Signed-off-by: Stephen F Taylor <steveftaylor@gmail.com>
2014-04-28 14:49:30 -06:00
Sage Weil
33b889f3f1 rbd-fuse: fix signed/unsigned warning
rbd_fuse/rbd-fuse.c: In function 'enumerate_images':
rbd_fuse/rbd-fuse.c:113:2: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Signed-off-by: Sage Weil <sage@inktank.com>
2014-03-13 11:24:48 -07:00
Ilya Dryomov
fe4ad291c6 rbd-fuse: fix enumerate_images() image names buffer size issue
Image names buffer is fixed at 1024.  This turns out to be not enough:
there are at least two "rbd-fuse rbd_list: error %d Numerical result
out of range" reports on the ML.  Fix it by calling rbd_list() twice to
first get the expected buffer size.  Also, get rid of the memory leak
and tweak the error message while at it.

Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>
2014-03-11 16:00:37 +02:00
majianpeng
63f5814855 ceph: Update FUSE_USE_VERSION from 26 to 30.
When compiling, it met this error:
>In file included from /usr/local/include/fuse/fuse.h:19:0,
>                 from client/fuse_ll.cc:17:
>/usr/local/include/fuse/fuse_common.h:474:4: error: #error only API
>version 30 or greater is supported
Update FUSE_USE_VERSION from 26 to 30.

Signed-off-by: Jianpeng Ma <majianpeng@gmail.com>
2013-10-02 14:42:43 -07:00
Roald J. van Loon
09b42c033f automake cleanup: renamed inttypes.h
- In "includes", inttypes.h was cluttering the system's one. This caused
  random build errors on some systems/in some conditions. Renaming it.
- Add emergency defs of PRI*64 headers when int_types.h does not define
  them (which, unfortunately, can happen on some systems).

Signed-off-by: Roald J. van Loon <roaldvanloon@gmail.com>
2013-09-07 22:41:10 +02:00
Danny Al-Gaaf
b9fe22b33c rbd_fuse/rbd-fuse.c: reduce scope of some variables in open_rbd_image()
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-05-16 14:20:09 +02:00
Danny Al-Gaaf
b6696822a0 rbd_fuse/rbd-fuse.c: remove consecutive return/break statement
Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-03-11 15:31:50 +01:00
Danny Al-Gaaf
3acc4d2cfe rbd-fuse: fix for loop in open_rbd_image()
Remove uninitialized usage of 'int i' as i++ from 'for' loop.
The variale 'i' is never used in this loop and initialized
before the next use with 0.

Related warning from clang++:

rbd_fuse/rbd-fuse.c:141:36: warning: variable 'i' is uninitialized
when used here [-Wuninitialized]
        for (im = rbd_images; im != NULL; i++, im = im->next) {

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-02-06 08:42:43 -08:00
Sage Weil
193dbedb91 rbd-fuse: fix warning
Signed-off-by: Sage Weil <sage@inktank.com>
2013-01-28 18:49:20 -08:00
Danny Al-Gaaf
818e9a2cd4 rbd-fuse: fix printf format for off_t and size_t
Fix printf format for off_t and size_t to print the same on 32 and 64bit
systems. Use PRI* macros from inttypes.h.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-01-28 13:56:32 -08:00
Danny Al-Gaaf
21673e8b9e rbd-fuse: fix usage of conn->want
Fix usage of conn->want and FUSE_CAP_BIG_WRITES. Both need libfuse
version >= 2.8. Encapsulate the related code line into a check for
the needed FUSE_VERSION as already done in ceph-fuse in some cases.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
2013-01-28 13:56:32 -08:00
Dan Mick
2a6dcabf7f rbd-fuse: add simple RBD FUSE client
Currently written in C on FUSE hi-level interfaces, so error reporting
could be better.  No serious work done for performance.  But it's
usable as it stands.

Specify -c <conf> and a mountpoint, and images show up as files in
that mountpoint.  You can create new images; they'll be created
with attributes stored in xattrs:

	user.rbdfuse.imagesize: default 1GB
	user.rbdfuse.imageorder: default 22
	user.rbdfuse.imagefeatures: default 1 (layering)

Images may be truncated or extended by rewriting.  Currently
once an image is opened, it's not closed, so it can't be deleted
or changed outside of the fuse path.

Signed-off-by: Dan Mick <dan.mick@inktank.com>
2013-01-25 21:27:53 -08:00
Andreas Bluemle
7daf372488 rbd-fuse: Original code from Andreas Bluemle
Signed-off-by: Andreas Bluemle <andreas.bluemle@itxperts.de>
2013-01-25 21:27:53 -08:00