"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "fsremap/src/extent.hh" between
fstransform-0.9.3-src.tar.gz and fstransform-0.9.4.tar.gz

About: fstransform is a tool to change a file-system from one format to another, for example from jfs, xfs, or reiser to ext2, ext3, or ext4, in-place and without the need for backup.

extent.hh  (fstransform-0.9.3-src):extent.hh  (fstransform-0.9.4)
skipping to change at line 30 skipping to change at line 30
* extent.hh * extent.hh
* *
* Created on: Feb 27, 2011 * Created on: Feb 27, 2011
* Author: max * Author: max
*/ */
#ifndef FSREMAP_EXTENT_HH #ifndef FSREMAP_EXTENT_HH
#define FSREMAP_EXTENT_HH #define FSREMAP_EXTENT_HH
#include "types.hh" // for ft_size #include "types.hh" // for ft_size
#include "log.hh" // for ff_log()
#include <utility> // for std_pair<T1,T2> #include <utility> // for std_pair<T1,T2>
FT_NAMESPACE_BEGIN FT_NAMESPACE_BEGIN
/** possible sources ('from') of a fr_work<T>::move*() or io::fr_io::copy() oper ation */ /** possible sources ('from') of a fr_work<T>::move*() or io::fr_io::copy() oper ation */
enum fr_from { FC_FROM_DEV = 0, FC_FROM_STORAGE = 1 }; enum fr_from { FC_FROM_DEV = 0, FC_FROM_STORAGE = 1 };
/** possible destinations ('to') of a fr_work<T>::move*() or io::fr_io::copy() o peration */ /** possible destinations ('to') of a fr_work<T>::move*() or io::fr_io::copy() o peration */
enum fr_to { FC_TO_DEV = 0, FC_TO_STORAGE = 2 }; enum fr_to { FC_TO_DEV = 0, FC_TO_STORAGE = 2 };
skipping to change at line 141 skipping to change at line 142
FT_INLINE T length() const { return this->second.length; } FT_INLINE T length() const { return this->second.length; }
FT_INLINE ft_size & user_data() { return this->second.user_data; } FT_INLINE ft_size & user_data() { return this->second.user_data; }
FT_INLINE ft_size user_data() const { return this->second.user_data; } FT_INLINE ft_size user_data() const { return this->second.user_data; }
void clear() { void clear() {
physical() = logical() = length() = 0; physical() = logical() = length() = 0;
user_data() = 0; user_data() = 0;
} }
/** print extents header to log */
static void show(ft_log_level level = FC_SHOW_DEFAULT_LEVEL)
{
ff_log(level, 0, "# extent physical logical leng
th user_data");
}
/** print extent to log */
static void show(ft_size i, T physical, T logical, T length, ft_size user_da
ta, ft_log_level level = FC_SHOW_DEFAULT_LEVEL)
{
ff_log(level, 0, "#%8" FT_ULL "\t%12" FT_ULL "\t%12" FT_ULL "\t%8" FT_UL
L "\t(%" FT_ULL ")", (ft_ull)i,
(ft_ull) physical, (ft_ull) logical, (ft_ull) length, (ft_ull) u
ser_data);
}
/** print extent to log */
static void show(ft_size i, const super_type & extent, ft_log_level level =
FC_SHOW_DEFAULT_LEVEL)
{
show(i, extent.first.physical, extent.second.logical, extent.second.leng
th, extent.second.user_data, level);
}
template<typename const_iter>
static void show(const_iter start, const_iter end, ft_size n,
const char * label1, const char * label2,
ft_uoff effective_block_size, ft_log_level level)
{
ft_log_level header_level = level >= FC_DEBUG ? level : (ft_log_level)(l
evel + 1);
if (!ff_log_is_enabled(header_level) && !ff_log_is_enabled(level))
return;
if (start != end) {
ff_log(header_level, 0, "# %4" FT_ULL " extent%s in %s%s",
(ft_ull) n, (n == 1 ? "" : "s"), label1, label2);
if (ff_log_is_enabled(level)) {
ff_log(level, 0, "# effective block size = %" FT_ULL, (ft_ull) e
ffective_block_size);
show(level);
for (ft_size i = 0; start != end; ++start, ++i)
show(i, *start, level);
}
} else {
ff_log(header_level, 0, "# no extents in %s%s", label1, label2);
}
ff_log(level, 0, "");
}
class comparator_physical class comparator_physical
{ {
public: public:
FT_INLINE bool operator()(const fr_extent<T> & e1, const fr_extent<T> & e2) FT_INLINE bool operator()(const fr_extent<T> & e1, const fr_extent<T> & e2)
{ {
return e1.physical() < e2.physical(); return e1.physical() < e2.physical();
} }
}; };
class comparator_logical class comparator_logical
 End of changes. 2 change blocks. 
0 lines changed or deleted 55 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)