diff options
author | Sage Weil <sage@inktank.com> | 2013-06-19 17:55:20 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-06-19 17:55:20 -0700 |
commit | cb6bc95a9cb9e272230e080471787b63fa080755 (patch) | |
tree | f3edfa3a88c6259ee75ca9f39c0764dc05ffec7e | |
parent | c830b7040cfbdf8c3f2025afc5a714ead21d023b (diff) | |
parent | 8c0daafe003935881c5192e0b6b59b949269e5ae (diff) | |
download | ceph-cb6bc95a9cb9e272230e080471787b63fa080755.tar.gz |
Merge remote-tracking branch 'gh/next'
-rwxr-xr-x | src/ceph-disk | 13 | ||||
-rw-r--r-- | src/os/FileStore.cc | 14 |
2 files changed, 18 insertions, 9 deletions
diff --git a/src/ceph-disk b/src/ceph-disk index bd7e6206ae8..93864c1c008 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -206,16 +206,11 @@ def list_partitions(disk): disk = os.path.realpath(disk) assert not is_partition(disk) assert disk.startswith('/dev/') - base = disk[5:] + base = disk.split('/')[-1] partitions = [] - with file('/proc/partitions', 'rb') as proc_partitions: - for line in proc_partitions.read().split('\n')[2:]: - fields = re.split('\s+', line) - if len(fields) < 5: - continue - name = fields [4] - if name != base and name.startswith(base): - partitions.append('/dev/' + name) + for name in os.listdir(os.path.join('/sys/block', base)): + if name.startswith(base): + partitions.append('/dev/' + name) return partitions diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 049539b73af..c1eacbc59da 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -90,6 +90,9 @@ using ceph::crypto::SHA1; # ifndef BTRFS_SUPER_MAGIC static const __SWORD_TYPE BTRFS_SUPER_MAGIC(0x9123683E); # endif +# ifndef XFS_SUPER_MAGIC +static const __SWORD_TYPE XFS_SUPER_MAGIC(0x58465342); +# endif #endif #define COMMIT_SNAP_ITEM "snap_%lld" @@ -1063,6 +1066,17 @@ int FileStore::_detect_fs() blk_size = st.f_bsize; #if defined(__linux__) + if (st.f_type == XFS_SUPER_MAGIC) { + dout(1) << "mount detected xfs" << dendl; + if (m_filestore_replica_fadvise) { + dout(1) << " disabling 'filestore replica fadvise' due to known issues with fadvise(DONTNEED) on xfs" << dendl; + g_conf->set_val("filestore_replica_fadvise", "false"); + assert(m_filestore_replica_fadvise == false); + } + } +#endif + +#if defined(__linux__) if (st.f_type == BTRFS_SUPER_MAGIC) { dout(0) << "mount detected btrfs" << dendl; wbthrottle.set_fs(WBThrottle::BTRFS); |