diff options
author | Kinglong Mee <kinglongmee@gmail.com> | 2018-02-12 15:13:49 +0800 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-02-12 21:34:46 +0000 |
commit | d01f7244e9d9f7e3ef84e0ba7b48ef1b1b09d809 (patch) | |
tree | 1a95023e8a4097e9a07ded99642228894876d8b5 /xlators | |
parent | bfb66cc535ce473afa7e330800d2d2c38afe42c9 (diff) |
gfapi: return pre/post attributes from glfs_pread/pwrite
As nfs-ganesha, a wcc data contains pre/post attributes is return
in read/write rpc reply. nfs-ganesha get those attributes by
two getattr between the real read/write right now.
But, gluster has return pre/post attributes from glusterfsd,
those attributes are skipped in syncop/gfapi, if gfapi return them,
the upper user (nfs-ganesha) can use them directly without any
duplicate getattr.
Updates: #389
Change-Id: I7b643ae4241cfe2aeb17063de00192d81674024a
Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/afr/src/afr-self-heal-data.c | 6 | ||||
-rw-r--r-- | xlators/cluster/dht/src/dht-rebalance.c | 5 | ||||
-rwxr-xr-x | xlators/experimental/fdl/src/gen_recon.py | 2 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.c | 2 | ||||
-rw-r--r-- | xlators/features/snapview-server/src/snapview-server.c | 12 |
5 files changed, 9 insertions, 18 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-data.c b/xlators/cluster/afr/src/afr-self-heal-data.c index c033a8afc07..bc710ea458f 100644 --- a/xlators/cluster/afr/src/afr-self-heal-data.c +++ b/xlators/cluster/afr/src/afr-self-heal-data.c @@ -128,7 +128,7 @@ __afr_is_sink_zero_filled (xlator_t *this, fd_t *fd, size_t size, priv = this->private; ret = syncop_readv (priv->children[sink], fd, size, offset, 0, &iovec, - &count, &iobref, NULL, NULL); + &count, &iobref, NULL, NULL, NULL); if (ret < 0) goto out; ret = iov_0filled (iovec, count); @@ -158,7 +158,7 @@ __afr_selfheal_data_read_write (call_frame_t *frame, xlator_t *this, fd_t *fd, priv = this->private; ret = syncop_readv (priv->children[source], fd, size, offset, 0, - &iovec, &count, &iobref, NULL, NULL); + &iovec, &count, &iobref, NULL, NULL, NULL); if (ret <= 0) return ret; @@ -207,7 +207,7 @@ __afr_selfheal_data_read_write (call_frame_t *frame, xlator_t *this, fd_t *fd, } ret = syncop_writev (priv->children[i], fd, iovec, count, - offset, iobref, 0, NULL, NULL); + offset, iobref, 0, NULL, NULL, NULL, NULL); if (ret != iov_length (iovec, count)) { /* write() failed on this sink. unset the corresponding member in sinks[] (which is healed_sinks[] in the diff --git a/xlators/cluster/dht/src/dht-rebalance.c b/xlators/cluster/dht/src/dht-rebalance.c index 4ebdf05387a..68afb2615a6 100644 --- a/xlators/cluster/dht/src/dht-rebalance.c +++ b/xlators/cluster/dht/src/dht-rebalance.c @@ -1159,7 +1159,7 @@ __dht_rebalance_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, ret = syncop_readv (from, src, read_size, offset, 0, &vector, &count, &iobref, NULL, - NULL); + NULL, NULL); if (!ret || (ret < 0)) { *fop_errno = -ret; break; @@ -1205,7 +1205,8 @@ __dht_rebalance_migrate_data (xlator_t *this, gf_defrag_info_t *defrag, } ret = syncop_writev (to, dst, vector, count, - offset, iobref, 0, xdata, NULL); + offset, iobref, 0, NULL, NULL, + xdata, NULL); if (ret < 0) { *fop_errno = -ret; } diff --git a/xlators/experimental/fdl/src/gen_recon.py b/xlators/experimental/fdl/src/gen_recon.py index 67f9ea9ebd3..57a5360a9f8 100755 --- a/xlators/experimental/fdl/src/gen_recon.py +++ b/xlators/experimental/fdl/src/gen_recon.py @@ -141,7 +141,7 @@ def get_special_subs (name, args, fop_type): # is not stored in or read from the journal. There are other ways to # do that, but this is the only place we need anything similar and we # already have to treat it as a special case so this is simplest. - s_args_str = 'fd, &vector, 1, off, iobref, flags, xdata' + s_args_str = 'fd, &vector, 1, off, iobref, flags, &preop, &postop, xdata' elif name == 'symlink': # Swap 'linkpath' and 'loc'. s_args_str = '&loc, linkpath, &iatt, xdata' diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c index db97ce54735..a9b70b61f8a 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot.c @@ -296,7 +296,7 @@ br_object_read_block_and_sign (xlator_t *this, fd_t *fd, br_child_t *child, ret = syncop_readv (child->xl, fd, size, offset, 0, &iovec, &count, &iobref, NULL, - NULL); + NULL, NULL); if (ret < 0) { gf_msg (this->name, GF_LOG_ERROR, errno, BRB_MSG_READV_FAILED, diff --git a/xlators/features/snapview-server/src/snapview-server.c b/xlators/features/snapview-server/src/snapview-server.c index 8fee435de64..18f00d7d2d8 100644 --- a/xlators/features/snapview-server/src/snapview-server.c +++ b/xlators/features/snapview-server/src/snapview-server.c @@ -1990,7 +1990,7 @@ svs_readv (call_frame_t *frame, xlator_t *this, goto out; } - ret = glfs_pread (glfd, iobuf->ptr, size, offset, 0); + ret = glfs_pread (glfd, iobuf->ptr, size, offset, 0, &fstatbuf); if (ret < 0) { op_ret = -1; op_errno = errno; @@ -2005,16 +2005,6 @@ svs_readv (call_frame_t *frame, xlator_t *this, iobref = iobref_new (); iobref_add (iobref, iobuf); - - ret = glfs_fstat (glfd, &fstatbuf); - if (ret) { - op_ret = -1; - op_errno = errno; - gf_log (this->name, GF_LOG_ERROR, "glfs_fstat failed after " - "readv on %s", uuid_utoa (fd->inode->gfid)); - goto out; - } - iatt_from_stat (&stbuf, &fstatbuf); gf_uuid_copy (stbuf.ia_gfid, fd->inode->gfid); svs_fill_ino_from_gfid (&stbuf); |