diff options
author | Niels de Vos <ndevos@redhat.com> | 2012-09-03 12:49:21 +0200 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-09-06 18:32:26 -0700 |
commit | c13823bd16b26bc471d3efb15f63b76fbfdf0309 (patch) | |
tree | 0195ee6b28ba6732bc579b5aa09624f0f2f38042 /xlators/mount/fuse/src/fuse-bridge.c | |
parent | baddf332d589d29d9bcb18d11dcbb875650e4298 (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: I3296d16528bfb50457b9675f6b8701234ed82ff0
BUG: 850352
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/3885
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.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 65a479aed8b..726e500e9e4 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -306,7 +306,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, @@ -513,7 +513,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 = @@ -565,7 +565,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 = @@ -847,7 +847,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 = @@ -1767,7 +1767,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); @@ -4622,6 +4622,8 @@ init (xlator_t *this_xl) GF_OPTION_INIT ("read-only", priv->read_only, bool, cleanup_exit); + GF_OPTION_INIT ("enable-ino32", priv->enable_ino32, bool, cleanup_exit); + priv->fuse_dump_fd = -1; ret = dict_get_str (options, "dump-fuse", &value_string); if (ret == 0) { @@ -4868,6 +4870,10 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_BOOL, .default_value = "false" }, + { .key = {"enable-ino32"}, + .type = GF_OPTION_TYPE_BOOL, + .default_value = "false" + }, { .key = {"background-qlen"}, .type = GF_OPTION_TYPE_INT, .default_value = "64", |