diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/storage/posix/src/posix.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index ef68aa72e3f..4f095d17bc9 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -1815,12 +1815,6 @@ posix_open (call_frame_t *frame, xlator_t *this, fd_ctx_set (fd, this, (uint64_t)(long)pfd); - LOCK (&priv->lock); - { - priv->stats.nr_files++; - } - UNLOCK (&priv->lock); - #ifndef HAVE_SET_FSID if (flags & O_CREAT) { op_ret = chown (real_path, frame->root->uid, gid); @@ -1863,6 +1857,12 @@ posix_open (call_frame_t *frame, xlator_t *this, } } + LOCK (&priv->lock); + { + priv->stats.nr_files++; + } + UNLOCK (&priv->lock); + op_ret = 0; out: @@ -2246,12 +2246,6 @@ posix_release (xlator_t *this, priv = this->private; - LOCK (&priv->lock); - { - priv->stats.nr_files--; - } - UNLOCK (&priv->lock); - ret = fd_ctx_get (fd, this, &tmp_pfd); if (ret < 0) { op_errno = -ret; @@ -2280,6 +2274,12 @@ posix_release (xlator_t *this, goto out; } + LOCK (&priv->lock); + { + priv->stats.nr_files--; + } + UNLOCK (&priv->lock); + op_ret = 0; out: |