diff options
author | Mohammed Junaid <junaid@redhat.com> | 2013-06-25 07:50:28 +0530 |
---|---|---|
committer | Peter Portante <pportant@redhat.com> | 2013-06-27 17:15:45 -0700 |
commit | c7ce3beec168cfc530da9e8d11fc1a0e8c80bcce (patch) | |
tree | 79100a6d0bc58a219f2c5784033fb7cff7276db6 /gluster/swift/common/DiskDir.py | |
parent | 41b91061436210afd1d22cad3c2ee1e038c23e3c (diff) |
object-storage: Use fchown instead of chown.
This is a step towards making fd based system calls where ever possible to avoid
path lookups.
Signed-off-by: Mohammed Junaid <junaid@redhat.com>
Change-Id: I482ea29ebe0859d0a5307ff25ecb5945d54bc7ca
Reviewed-on: http://review.gluster.org/5251
Reviewed-by: Peter Portante <pportant@redhat.com>
Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'gluster/swift/common/DiskDir.py')
-rw-r--r-- | gluster/swift/common/DiskDir.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gluster/swift/common/DiskDir.py b/gluster/swift/common/DiskDir.py index c5793f5..364c95e 100644 --- a/gluster/swift/common/DiskDir.py +++ b/gluster/swift/common/DiskDir.py @@ -16,7 +16,8 @@ import os import errno -from gluster.swift.common.fs_utils import dir_empty, rmdirs, mkdirs, os_path +from gluster.swift.common.fs_utils import dir_empty, rmdirs, mkdirs, os_path, \ + do_chown from gluster.swift.common.utils import validate_account, validate_container, \ get_container_details, get_account_details, create_container_metadata, \ create_account_metadata, DEFAULT_GID, get_container_metadata, \ @@ -454,7 +455,7 @@ class DiskDir(DiskCommon): if not self._dir_exists: mkdirs(self.datadir) # If we create it, ensure we own it. - os.chown(self.datadir, self.uid, self.gid) + do_chown(self.datadir, self.uid, self.gid) metadata = get_container_metadata(self.datadir) metadata[X_TIMESTAMP] = timestamp write_metadata(self.datadir, metadata) |