summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse/src/fuse-bridge.c
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2012-09-03 13:34:22 +0200
committerAnand Avati <avati@redhat.com>2013-02-07 13:38:20 -0800
commitfbb9ad5030abf058ce75af1890b7ec1be77d22f9 (patch)
tree5895f7474ea5b728236e90216cf94805807a22b5 /xlators/mount/fuse/src/fuse-bridge.c
parent0f4bd1706f9243a0ae3569c47889ba7a784be23a (diff)
mount/fuse: add mount-option "enable-ino32" for the native client
By default the GlusterFS-native client uses 64-bit inodes. Some 32-bit applications can not handle these correctly. Introduce a client-side mount option "enable-ino32" which causes the FUSE-client to squash the 64-bit inodes into a 32-bit value. Change-Id: I7544010a27b7eb2d3b9fadb84ed934e4e7dff21e BUG: 850352 Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/3886 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mount/fuse/src/fuse-bridge.c')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 51e644269..ed24c7382 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -246,7 +246,7 @@ fuse_entry_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state->loc.path, buf->ia_ino);
buf->ia_blksize = this->ctx->page_size;
- gf_fuse_stat2attr (buf, &feo.attr);
+ gf_fuse_stat2attr (buf, &feo.attr, priv->enable_ino32);
if (!buf->ia_ino) {
gf_log ("glusterfs-fuse", GF_LOG_WARNING,
@@ -437,7 +437,7 @@ fuse_truncate_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
prebuf->ia_ino);
postbuf->ia_blksize = this->ctx->page_size;
- gf_fuse_stat2attr (postbuf, &fao.attr);
+ gf_fuse_stat2attr (postbuf, &fao.attr, priv->enable_ino32);
fao.attr_valid = calc_timeout_sec (priv->attribute_timeout);
fao.attr_valid_nsec =
@@ -489,7 +489,7 @@ fuse_attr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
buf->ia_ino);
buf->ia_blksize = this->ctx->page_size;
- gf_fuse_stat2attr (buf, &fao.attr);
+ gf_fuse_stat2attr (buf, &fao.attr, priv->enable_ino32);
fao.attr_valid = calc_timeout_sec (priv->attribute_timeout);
fao.attr_valid_nsec =
@@ -761,7 +761,7 @@ fuse_setattr_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
statpost->ia_ino);
statpost->ia_blksize = this->ctx->page_size;
- gf_fuse_stat2attr (statpost, &fao.attr);
+ gf_fuse_stat2attr (statpost, &fao.attr, priv->enable_ino32);
fao.attr_valid = calc_timeout_sec (priv->attribute_timeout);
fao.attr_valid_nsec =
@@ -1673,7 +1673,7 @@ fuse_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
state->loc.path, fd, buf->ia_ino);
buf->ia_blksize = this->ctx->page_size;
- gf_fuse_stat2attr (buf, &feo.attr);
+ gf_fuse_stat2attr (buf, &feo.attr, priv->enable_ino32);
linked_inode = inode_link (inode, state->loc.parent,
state->loc.name, buf);
@@ -4515,6 +4515,13 @@ init (xlator_t *this_xl)
GF_ASSERT (ret == 0);
}
+ priv->enable_ino32 = 0;
+ ret = dict_get_str (options, "enable-ino32", &value_string);
+ if (ret == 0) {
+ ret = gf_string2boolean (value_string, &priv->enable_ino32);
+ GF_ASSERT (ret == 0);
+ }
+
priv->fuse_dump_fd = -1;
ret = dict_get_str (options, "dump-fuse", &value_string);
if (ret == 0) {