diff options
author | Mohit Agrawal <moagrawa@redhat.com> | 2017-07-15 17:55:14 +0530 |
---|---|---|
committer | Jeff Darcy <jeff@pl.atyp.us> | 2017-10-30 15:53:46 +0000 |
commit | a320f2021ee4dcab85483dbe10d85e797bd6b3b4 (patch) | |
tree | 4b9c2993b72dd388c33e5e40578ea9000e7f8494 /xlators/storage/posix/src/posix-helpers.c | |
parent | ae9b006f23b1408ff548348440369d056becdc1d (diff) |
posix: Ignore disk space reserve check for internal FOPS
Problem: Currently disk space reserve check is applicable for internal FOP
also it needs to be ignore for internal FOP.
Solution: Update the DISK_SPACE_CHECK_AND_GOTO macro at posix component.
Macro will call only while key "GLUSTERFS_INTERNAL_FOP_KEY"
exists in xdata.
BUG: 1506083
Change-Id: I2b0840bbf4fa14bc247855b024ca136773d68d16
Signed-off-by: Mohit Agrawal <moagrawa@redhat.com>
Diffstat (limited to 'xlators/storage/posix/src/posix-helpers.c')
-rw-r--r-- | xlators/storage/posix/src/posix-helpers.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/xlators/storage/posix/src/posix-helpers.c b/xlators/storage/posix/src/posix-helpers.c index 826441f1dd7..77affc45ae0 100644 --- a/xlators/storage/posix/src/posix-helpers.c +++ b/xlators/storage/posix/src/posix-helpers.c @@ -1990,10 +1990,10 @@ posix_disk_space_check (xlator_t *this) GF_VALIDATE_OR_GOTO (this->name, this, out); priv = this->private; - GF_VALIDATE_OR_GOTO ("posix-helpers", priv, out); + GF_VALIDATE_OR_GOTO (this->name, priv, out); subvol_path = priv->base_path; - percent = priv->disk_threshhold; + percent = priv->disk_reserve; op_ret = sys_statvfs (subvol_path, &buf); @@ -2073,9 +2073,9 @@ posix_spawn_disk_space_check_thread (xlator_t *xl) priv->disk_space_check_active = _gf_false; } - ret = gf_thread_create (&priv->disk_space_check, NULL, - posix_disk_space_check_thread_proc, - xl, "posix_reserve"); + ret = gf_thread_create_detached (&priv->disk_space_check, + posix_disk_space_check_thread_proc, + xl, "posix_reserve"); if (ret < 0) { priv->disk_space_check_active = _gf_false; gf_msg (xl->name, GF_LOG_ERROR, errno, @@ -2084,8 +2084,6 @@ posix_spawn_disk_space_check_thread (xlator_t *xl) goto unlock; } - /* run the thread detached, resources will be freed on exit */ - pthread_detach (priv->disk_space_check); priv->disk_space_check_active = _gf_true; } unlock: |