diff options
39 files changed, 123 insertions, 85 deletions
diff --git a/libglusterfs/src/call-stub.c b/libglusterfs/src/call-stub.c index 89788b3b8dc..4e62276fc5f 100644 --- a/libglusterfs/src/call-stub.c +++ b/libglusterfs/src/call-stub.c @@ -772,11 +772,9 @@ out: call_stub_t * -fop_create_stub (call_frame_t *frame, - fop_create_t fn, - loc_t *loc, - int32_t flags, - mode_t mode, fd_t *fd) +fop_create_stub (call_frame_t *frame, fop_create_t fn, + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { call_stub_t *stub = NULL; @@ -792,6 +790,8 @@ fop_create_stub (call_frame_t *frame, stub->args.create.mode = mode; if (fd) stub->args.create.fd = fd_ref (fd); + if (params) + stub->args.create.params = dict_ref (params); out: return stub; } @@ -2130,7 +2130,8 @@ call_resume_wind (call_stub_t *stub) &stub->args.create.loc, stub->args.create.flags, stub->args.create.mode, - stub->args.create.fd); + stub->args.create.fd, + stub->args.create.params); break; } case GF_FOP_STAT: @@ -3315,6 +3316,8 @@ call_stub_destroy_wind (call_stub_t *stub) loc_wipe (&stub->args.create.loc); if (stub->args.create.fd) fd_unref (stub->args.create.fd); + if (stub->args.create.params) + dict_unref (stub->args.create.params); break; } case GF_FOP_STAT: diff --git a/libglusterfs/src/call-stub.h b/libglusterfs/src/call-stub.h index a284ef929a7..fd79cc2d6cf 100644 --- a/libglusterfs/src/call-stub.h +++ b/libglusterfs/src/call-stub.h @@ -232,6 +232,7 @@ typedef struct { int32_t flags; mode_t mode; fd_t *fd; + dict_t *params; } create; struct { fop_create_cbk_t fn; @@ -778,11 +779,9 @@ fop_link_cbk_stub (call_frame_t *frame, struct iatt *postparent); call_stub_t * -fop_create_stub (call_frame_t *frame, - fop_create_t fn, - loc_t *loc, - int32_t flags, - mode_t mode, fd_t *fd); +fop_create_stub (call_frame_t *frame, fop_create_t fn, + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params); call_stub_t * fop_create_cbk_stub (call_frame_t *frame, diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c index f5317cf8648..8a450b6d6d6 100644 --- a/libglusterfs/src/defaults.c +++ b/libglusterfs/src/defaults.c @@ -471,16 +471,14 @@ default_create_cbk (call_frame_t *frame, } int32_t -default_create (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - int32_t flags, - mode_t mode, fd_t *fd) +default_create (call_frame_t *frame, xlator_t *this, + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { STACK_WIND (frame, default_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/libglusterfs/src/defaults.h b/libglusterfs/src/defaults.h index 2955bd8eb78..751380d3207 100644 --- a/libglusterfs/src/defaults.h +++ b/libglusterfs/src/defaults.h @@ -116,11 +116,9 @@ int32_t default_link (call_frame_t *frame, loc_t *oldloc, loc_t *newloc); -int32_t default_create (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - int32_t flags, - mode_t mode, fd_t *fd); +int32_t default_create (call_frame_t *frame, xlator_t *this, + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params); int32_t default_open (call_frame_t *frame, xlator_t *this, diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index 208f7a64a56..10f0418df2d 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -477,12 +477,9 @@ typedef int32_t (*fop_link_t) (call_frame_t *frame, loc_t *oldloc, loc_t *newloc); -typedef int32_t (*fop_create_t) (call_frame_t *frame, - xlator_t *this, - loc_t *loc, - int32_t flags, - mode_t mode, - fd_t *fd); +typedef int32_t (*fop_create_t) (call_frame_t *frame, xlator_t *this, + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params); /* Tell subsequent writes on the fd_t to fsync after every writev fop without * requiring a fsync fop. diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c index 22bb4322edd..6a732e1180d 100644 --- a/xlators/cluster/afr/src/afr-common.c +++ b/xlators/cluster/afr/src/afr-common.c @@ -391,6 +391,8 @@ afr_local_cleanup (afr_local_t *local, xlator_t *this) { /* create */ if (local->cont.create.fd) fd_unref (local->cont.create.fd); + if (local->cont.create.params) + dict_unref (local->cont.create.params); } { /* writev */ diff --git a/xlators/cluster/afr/src/afr-dir-write.c b/xlators/cluster/afr/src/afr-dir-write.c index 27dd3517794..3e9f48f9a2c 100644 --- a/xlators/cluster/afr/src/afr-dir-write.c +++ b/xlators/cluster/afr/src/afr-dir-write.c @@ -253,7 +253,8 @@ afr_create_wind (call_frame_t *frame, xlator_t *this) &local->loc, local->cont.create.flags, local->cont.create.mode, - local->cont.create.fd); + local->cont.create.fd, + local->cont.create.params); if (!--call_count) break; } @@ -280,7 +281,8 @@ afr_create_done (call_frame_t *frame, xlator_t *this) int afr_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { afr_private_t * priv = NULL; afr_local_t * local = NULL; @@ -326,6 +328,8 @@ afr_create (call_frame_t *frame, xlator_t *this, local->cont.create.flags = flags; local->cont.create.mode = mode; local->cont.create.fd = fd_ref (fd); + if (params) + local->cont.create.params = dict_ref (params); if (loc->parent) local->cont.create.parent_ino = loc->parent->ino; diff --git a/xlators/cluster/afr/src/afr-dir-write.h b/xlators/cluster/afr/src/afr-dir-write.h index 4fa618b6575..5369ba968a0 100644 --- a/xlators/cluster/afr/src/afr-dir-write.h +++ b/xlators/cluster/afr/src/afr-dir-write.h @@ -22,7 +22,8 @@ int32_t afr_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd); + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params); int32_t afr_mknod (call_frame_t *frame, xlator_t *this, diff --git a/xlators/cluster/afr/src/afr.h b/xlators/cluster/afr/src/afr.h index 6df8c697ca6..f222cb0f866 100644 --- a/xlators/cluster/afr/src/afr.h +++ b/xlators/cluster/afr/src/afr.h @@ -480,6 +480,7 @@ typedef struct _afr_local { uint64_t gen; ino_t parent_ino; fd_t *fd; + dict_t *params; int32_t flags; mode_t mode; inode_t *inode; diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index cef73a9d681..17ddb3247ab 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3242,7 +3242,8 @@ dht_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, STACK_WIND (frame, dht_create_cbk, cached_subvol, cached_subvol->fops->create, - &local->loc, local->flags, local->mode, local->fd); + &local->loc, local->flags, local->mode, + local->fd, local->params); return 0; err: @@ -3252,7 +3253,8 @@ dht_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, int dht_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { int op_errno = -1; int ret = -1; @@ -3284,7 +3286,7 @@ dht_create (call_frame_t *frame, xlator_t *this, local->loc.path, subvol->name, loc->path); STACK_WIND (frame, dht_create_cbk, subvol, subvol->fops->create, - &local->loc, flags, mode, fd); + &local->loc, flags, mode, fd, params); goto done; } @@ -3309,7 +3311,7 @@ dht_create (call_frame_t *frame, xlator_t *this, "creating %s on %s", loc->path, subvol->name); STACK_WIND (frame, dht_create_cbk, subvol, subvol->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); goto done; } /* Choose the minimum filled volume, and create the @@ -3318,6 +3320,7 @@ dht_create (call_frame_t *frame, xlator_t *this, avail_subvol = dht_free_disk_available_subvol (this, subvol); if (avail_subvol != subvol) { local->fd = fd_ref (fd); + local->params = dict_ref (params); local->flags = flags; local->mode = mode; @@ -3335,7 +3338,7 @@ dht_create (call_frame_t *frame, xlator_t *this, "creating %s on %s", loc->path, subvol->name); STACK_WIND (frame, dht_create_cbk, subvol, subvol->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); done: return 0; diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index 464832c4125..58edca9f66c 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -81,6 +81,7 @@ struct dht_local { struct statvfs statvfs; fd_t *fd; inode_t *inode; + dict_t *params; dict_t *xattr; dict_t *xattr_req; dht_layout_t *layout; diff --git a/xlators/cluster/dht/src/dht-helper.c b/xlators/cluster/dht/src/dht-helper.c index 6580f788db9..09c326289b8 100644 --- a/xlators/cluster/dht/src/dht-helper.c +++ b/xlators/cluster/dht/src/dht-helper.c @@ -199,6 +199,11 @@ dht_local_wipe (xlator_t *this, dht_local_t *local) local->fd = NULL; } + if (local->params) { + dict_unref (local->params); + local->params = NULL; + } + if (local->xattr_req) dict_unref (local->xattr_req); diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c index aaad5d5fa6e..e807ff304e0 100644 --- a/xlators/cluster/dht/src/nufa.c +++ b/xlators/cluster/dht/src/nufa.c @@ -302,7 +302,9 @@ nufa_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, STACK_WIND (frame, dht_create_cbk, local->cached_subvol, local->cached_subvol->fops->create, - &local->loc, local->flags, local->mode, local->fd); + &local->loc, local->flags, local->mode, local->fd, + local->params); + return 0; err: @@ -313,7 +315,8 @@ nufa_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, int nufa_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -365,6 +368,7 @@ nufa_create (call_frame_t *frame, xlator_t *this, } local->fd = fd_ref (fd); + local->params = dict_ref (params); local->mode = mode; local->flags = flags; @@ -380,7 +384,7 @@ nufa_create (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_create_cbk, subvol, subvol->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c index 5ec9e665731..f47ffb1fde4 100644 --- a/xlators/cluster/dht/src/switch.c +++ b/xlators/cluster/dht/src/switch.c @@ -405,7 +405,8 @@ switch_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, STACK_WIND (frame, dht_create_cbk, local->cached_subvol, local->cached_subvol->fops->create, - &local->loc, local->flags, local->mode, local->fd); + &local->loc, local->flags, local->mode, local->fd, + local->params); return 0; @@ -417,7 +418,8 @@ switch_create_linkfile_create_cbk (call_frame_t *frame, void *cookie, int switch_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { dht_local_t *local = NULL; dht_conf_t *conf = NULL; @@ -483,7 +485,7 @@ switch_create (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, dht_create_cbk, subvol, subvol->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c index 05012b8914c..a13bba34f52 100644 --- a/xlators/cluster/stripe/src/stripe.c +++ b/xlators/cluster/stripe/src/stripe.c @@ -2055,7 +2055,7 @@ out: */ int32_t stripe_create (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t flags, mode_t mode, fd_t *fd) + int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { stripe_private_t *priv = NULL; stripe_local_t *local = NULL; @@ -2102,7 +2102,8 @@ stripe_create (call_frame_t *frame, xlator_t *this, loc_t *loc, trav = this->children; while (trav) { STACK_WIND (frame, stripe_create_cbk, trav->xlator, - trav->xlator->fops->create, loc, flags, mode, fd); + trav->xlator->fops->create, loc, flags, + mode, fd, params); trav = trav->next; } diff --git a/xlators/debug/error-gen/src/error-gen.c b/xlators/debug/error-gen/src/error-gen.c index 8e37d7a1c6e..0a2e77d26d5 100644 --- a/xlators/debug/error-gen/src/error-gen.c +++ b/xlators/debug/error-gen/src/error-gen.c @@ -971,7 +971,7 @@ error_gen_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int error_gen_create (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t flags, mode_t mode, fd_t *fd) + int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { int op_errno = 0; eg_t *egp = NULL; @@ -993,7 +993,7 @@ error_gen_create (call_frame_t *frame, xlator_t *this, loc_t *loc, STACK_WIND (frame, error_gen_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/debug/io-stats/src/io-stats.c b/xlators/debug/io-stats/src/io-stats.c index 97a14ce4592..adc45ae87a9 100644 --- a/xlators/debug/io-stats/src/io-stats.c +++ b/xlators/debug/io-stats/src/io-stats.c @@ -1017,7 +1017,8 @@ io_stats_open (call_frame_t *frame, xlator_t *this, int io_stats_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, + fd_t *fd, dict_t *params) { BUMP_FOP (CREATE); @@ -1026,7 +1027,7 @@ io_stats_create (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, io_stats_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index 7f8681ea75a..16ea557933f 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -1593,7 +1593,7 @@ trace_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int trace_create (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t flags, mode_t mode, fd_t *fd) + int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { if (trace_fop_names[GF_FOP_CREATE].enabled) { gf_log (this->name, GF_LOG_NORMAL, @@ -1604,7 +1604,7 @@ trace_create (call_frame_t *frame, xlator_t *this, loc_t *loc, STACK_WIND (frame, trace_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/features/access-control/src/access-control.c b/xlators/features/access-control/src/access-control.c index c33eb55a15f..407596684f6 100644 --- a/xlators/features/access-control/src/access-control.c +++ b/xlators/features/access-control/src/access-control.c @@ -1156,10 +1156,11 @@ out: int32_t ac_create_resume (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t flags, mode_t mode, fd_t *fd) + int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { STACK_WIND (frame, default_create_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->create, loc, flags, mode, fd); + FIRST_CHILD(this)->fops->create, loc, flags, mode, + fd, params); return 0; } @@ -1197,13 +1198,14 @@ out: int32_t ac_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { call_stub_t *stub = NULL; int ret = -EFAULT; loc_t parentloc = {0, }; - stub = fop_create_stub (frame, ac_create_resume, loc, flags, mode, fd); + stub = fop_create_stub (frame, ac_create_resume, loc, flags, mode, + fd, params); if (!stub) { gf_log (this->name, GF_LOG_ERROR, "cannot create call stub: " "(out of memory)"); diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 9d4f01a11ec..37bec028ee7 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -466,11 +466,11 @@ unwind: int pl_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { STACK_WIND (frame, pl_create_cbk, FIRST_CHILD (this), FIRST_CHILD (this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index 6d1d195b8ec..82107a0a1fc 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -635,7 +635,7 @@ quota_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int quota_create (call_frame_t *frame, xlator_t *this, - loc_t *loc, int32_t flags, mode_t mode, fd_t *fd) + loc_t *loc, int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { struct quota_priv *priv = NULL; @@ -662,7 +662,7 @@ quota_create (call_frame_t *frame, xlator_t *this, STACK_WIND (frame, quota_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/features/read-only/src/read-only.c b/xlators/features/read-only/src/read-only.c index b8ba9218415..85cd4c8e365 100644 --- a/xlators/features/read-only/src/read-only.c +++ b/xlators/features/read-only/src/read-only.c @@ -171,7 +171,7 @@ ro_link (call_frame_t *frame, xlator_t *this, loc_t *oldloc, loc_t *newloc) int32_t ro_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { STACK_UNWIND_STRICT (create, frame, -1, EROFS, NULL, NULL, NULL, NULL, NULL); diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index 7a0b6f2b880..dd61929d7ff 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -899,7 +899,7 @@ trash_truncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, &local->newloc, flags, st_mode_from_ia (prot, local->loc.inode->ia_type), - local->newfd); + local->newfd, NULL); goto out; } } @@ -1003,7 +1003,7 @@ trash_truncate_stat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, FIRST_CHILD(this)->fops->create, &local->newloc, flags, st_mode_from_ia (buf->ia_prot, local->loc.inode->ia_type), - local->newfd); + local->newfd, NULL); return 0; } @@ -1268,7 +1268,7 @@ trash_ftruncate_mkdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, FIRST_CHILD(this)->fops->create, &local->newloc, flags, st_mode_from_ia (prot, local->loc.inode->ia_type), - local->newfd); + local->newfd, NULL); goto out; } } @@ -1340,7 +1340,7 @@ trash_ftruncate_fstat_cbk (call_frame_t *frame, void *cookie, xlator_t *this, FIRST_CHILD(this)->fops->create, &local->newloc, ( O_CREAT | O_EXCL | O_WRONLY ), st_mode_from_ia (buf->ia_prot, local->loc.inode->ia_type), - local->newfd); + local->newfd, NULL); return 0; } diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 97309194819..18e4d918031 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -1519,7 +1519,8 @@ fuse_create_resume (fuse_state_t *state) state->loc.path); FUSE_FOP (state, fuse_create_cbk, GF_FOP_CREATE, - create, &state->loc, state->flags, state->mode, fd); + create, &state->loc, state->flags, state->mode, + fd, NULL); } diff --git a/xlators/nfs/server/src/nfs-fops.c b/xlators/nfs/server/src/nfs-fops.c index b5ff937825d..08d3d6a46d8 100644 --- a/xlators/nfs/server/src/nfs-fops.c +++ b/xlators/nfs/server/src/nfs-fops.c @@ -604,8 +604,9 @@ nfs_fop_create (xlator_t *nfsx, xlator_t *xl, nfs_user_t *nfu, loc_t *pathloc, nfs_fop_handle_local_init (frame, nfsx, nfl, cbk, local, ret, err); nfs_fop_save_root_ino (nfl, pathloc); - STACK_WIND_COOKIE (frame, nfs_fop_create_cbk, xl, xl,xl->fops->create - , pathloc, flags, mode, fd); + STACK_WIND_COOKIE (frame, nfs_fop_create_cbk, xl, xl, xl->fops->create, + pathloc, flags, mode, fd, NULL); + ret = 0; err: if (ret < 0) { diff --git a/xlators/performance/io-cache/src/io-cache.c b/xlators/performance/io-cache/src/io-cache.c index 211f47ece8a..88b4c7dbb2c 100644 --- a/xlators/performance/io-cache/src/io-cache.c +++ b/xlators/performance/io-cache/src/io-cache.c @@ -783,7 +783,7 @@ ioc_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, */ int32_t ioc_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { ioc_local_t *local = NULL; @@ -800,7 +800,8 @@ ioc_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, frame->local = local; STACK_WIND (frame, ioc_create_cbk, FIRST_CHILD(this), - FIRST_CHILD(this)->fops->create, loc, flags, mode, fd); + FIRST_CHILD(this)->fops->create, loc, flags, mode, + fd, params); return 0; } diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 3e65306ced1..5992944ab42 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -737,25 +737,25 @@ iot_create_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int iot_create_wrapper (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t flags, mode_t mode, fd_t *fd) + int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { STACK_WIND (frame, iot_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } int iot_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { call_stub_t *stub = NULL; int ret = -1; stub = fop_create_stub (frame, iot_create_wrapper, loc, flags, mode, - fd); + fd, params); if (!stub) { gf_log (this->name, GF_LOG_ERROR, "cannot create \"create\" call stub" diff --git a/xlators/performance/read-ahead/src/read-ahead.c b/xlators/performance/read-ahead/src/read-ahead.c index 2b6e2dc8800..067c5b29a31 100644 --- a/xlators/performance/read-ahead/src/read-ahead.c +++ b/xlators/performance/read-ahead/src/read-ahead.c @@ -201,12 +201,12 @@ ra_open (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, int ra_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { STACK_WIND (frame, ra_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/performance/stat-prefetch/src/stat-prefetch.c b/xlators/performance/stat-prefetch/src/stat-prefetch.c index 0fad5285c24..6039bd019b9 100644 --- a/xlators/performance/stat-prefetch/src/stat-prefetch.c +++ b/xlators/performance/stat-prefetch/src/stat-prefetch.c @@ -1510,7 +1510,7 @@ out: int32_t sp_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { sp_local_t *local = NULL; int32_t op_errno = -1, ret = -1; @@ -1562,7 +1562,7 @@ out: } else { STACK_WIND (frame, sp_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, loc, flags, - mode, fd); + mode, fd, params); } return 0; } diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 23f2d56b95a..4437afce0cf 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -1422,15 +1422,14 @@ out: int32_t wb_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { frame->local = (void *)(long)flags; - STACK_WIND (frame, - wb_create_cbk, + STACK_WIND (frame, wb_create_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->create, - loc, flags, mode, fd); + loc, flags, mode, fd, params); return 0; } diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 02479607ece..98289b1d67e 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -559,7 +559,7 @@ out: int32_t client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, - int32_t flags, mode_t mode, fd_t *fd) + int32_t flags, mode_t mode, fd_t *fd, dict_t *params) { int ret = -1; clnt_conf_t *conf = NULL; diff --git a/xlators/protocol/legacy/client/src/client-protocol.c b/xlators/protocol/legacy/client/src/client-protocol.c index 64f513bf43c..e688e0e56b2 100644 --- a/xlators/protocol/legacy/client/src/client-protocol.c +++ b/xlators/protocol/legacy/client/src/client-protocol.c @@ -685,7 +685,7 @@ protocol_client_xfer (call_frame_t *frame, xlator_t *this, transport_t *trans, int client_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, - mode_t mode, fd_t *fd) + mode_t mode, fd_t *fd, dict_t *params) { gf_hdr_common_t *hdr = NULL; gf_fop_create_req_t *req = NULL; diff --git a/xlators/protocol/legacy/server/src/server-helpers.c b/xlators/protocol/legacy/server/src/server-helpers.c index 79104752ff1..08f89af5aba 100644 --- a/xlators/protocol/legacy/server/src/server-helpers.c +++ b/xlators/protocol/legacy/server/src/server-helpers.c @@ -86,6 +86,11 @@ free_old_server_state (server_state_t *state) state->fd = NULL; } + if (state->params) { + dict_unref (state->params); + state->params = NULL; + } + if (state->iobref) { iobref_unref (state->iobref); state->iobref = NULL; diff --git a/xlators/protocol/legacy/server/src/server-protocol.c b/xlators/protocol/legacy/server/src/server-protocol.c index 56acc59b791..1fbe86923a0 100644 --- a/xlators/protocol/legacy/server/src/server-protocol.c +++ b/xlators/protocol/legacy/server/src/server-protocol.c @@ -2885,7 +2885,8 @@ server_create_resume (call_frame_t *frame, xlator_t *bound_xl) STACK_WIND (frame, server_create_cbk, bound_xl, bound_xl->fops->create, - &(state->loc), state->flags, state->mode, state->fd); + &(state->loc), state->flags, state->mode, + state->fd, state->params); return 0; err: diff --git a/xlators/protocol/legacy/server/src/server-protocol.h b/xlators/protocol/legacy/server/src/server-protocol.h index 56d23fdbfab..13691287132 100644 --- a/xlators/protocol/legacy/server/src/server-protocol.h +++ b/xlators/protocol/legacy/server/src/server-protocol.h @@ -163,6 +163,7 @@ struct _server_state { int valid; fd_t *fd; + dict_t *params; int flags; int wbflags; struct iobuf *iobuf; diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c index af1ba1a4eb8..eab8f571d93 100644 --- a/xlators/protocol/server/src/server-helpers.c +++ b/xlators/protocol/server/src/server-helpers.c @@ -105,6 +105,11 @@ free_state (server_state_t *state) state->fd = NULL; } + if (state->params) { + dict_unref (state->params); + state->params = NULL; + } + if (state->iobref) { iobref_unref (state->iobref); state->iobref = NULL; diff --git a/xlators/protocol/server/src/server.h b/xlators/protocol/server/src/server.h index b58e8a5fada..453eee57e1c 100644 --- a/xlators/protocol/server/src/server.h +++ b/xlators/protocol/server/src/server.h @@ -162,6 +162,7 @@ struct _server_state { int valid; fd_t *fd; + dict_t *params; int flags; int wbflags; struct iovec payload_vector[MAX_IOVEC]; diff --git a/xlators/protocol/server/src/server3_1-fops.c b/xlators/protocol/server/src/server3_1-fops.c index 7748ef81324..644b84a2072 100644 --- a/xlators/protocol/server/src/server3_1-fops.c +++ b/xlators/protocol/server/src/server3_1-fops.c @@ -2492,7 +2492,8 @@ server_create_resume (call_frame_t *frame, xlator_t *bound_xl) STACK_WIND (frame, server_create_cbk, bound_xl, bound_xl->fops->create, - &(state->loc), state->flags, state->mode, state->fd); + &(state->loc), state->flags, state->mode, + state->fd, state->params); return 0; err: diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 6788606f341..aae903fee07 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1998,7 +1998,7 @@ posix_truncate (call_frame_t *frame, int32_t posix_create (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags, mode_t mode, - fd_t *fd) + fd_t *fd, dict_t *params) { int32_t op_ret = -1; int32_t op_errno = 0; |