~ubuntu-branches/ubuntu/lucid/e2fsprogs/lucid-updates

« back to all changes in this revision

Viewing changes to lib/ext2fs/fiemap.h

  • Committer: Bazaar Package Importer
  • Author(s): Theodore Y. Ts'o
  • Date: 2009-08-23 10:08:52 UTC
  • mfrom: (1.2.3 upstream) (8.1.7 sid)
  • mto: This revision was merged to the branch mainline in revision 32.
  • Revision ID: james.westby@ubuntu.com-20090823100852-688awkqsqx817bfg
Tags: 1.41.9-1
* New upstream release
* Fix tune2fs -I to work correctly in the face of bad blocks and
  filesystems formatted for RAID arrays, and ENOSPC errors
* Require the user to only answer one question instead of multiple
  ones for multiple bad block group checksums, or when an inode
  table needs to be moved.
* Fix e2fsck to handle moving inode tables in FLEX_BG filesystems more
  gracefully by looking in the entire flex_bg for space, instead of
  just in the block group; if that doesn't work, try looking for
  space in the entire filesystem.
* Fix the filefrag code to avoid printing the extent header if it
  needs to fallback to using the FIBMAP ioctl.
* Fix filefrag to print the correct number of extents for zero-length
  files when using FIBMAP.  (Closes: #540376)
* Add a filefrag -B option to make it easier to debug the FIBMAP
  support.
* Allow e2fsprogs programs to allocate from uninitalized block groups.
* Add a new program, e2freefrag, which displays information about the
  free space fragmentation in an ext2/3/4 filesystem.
* E2fsck will now print much fuller information when the last mount
  time or last written time is in the future, since most people can't
  seem to believe their distribution has buggy init scripts, or they
  have a failed CMOS/RTS clock battery.
* Update French, Polish, Czech, and Sweedish translation from the
  Translation Project.
* Enhance debugfs's 'stat' command to print basic extent information
  for extent-mapped inodes, and add a new command, 'dump_extents'
  which prints detailed information about an inode's extent tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * FS_IOC_FIEMAP ioctl infrastructure.
 
3
 *
 
4
 * Some portions copyright (C) 2007 Cluster File Systems, Inc
 
5
 *
 
6
 * Authors: Mark Fasheh <mfasheh@suse.com>
 
7
 *          Kalpak Shah <kalpak.shah@sun.com>
 
8
 *          Andreas Dilger <adilger@sun.com>
 
9
 */
 
10
 
 
11
#ifndef _LINUX_FIEMAP_H
 
12
#define _LINUX_FIEMAP_H
 
13
 
 
14
#include <linux/types.h>
 
15
 
 
16
struct fiemap_extent {
 
17
        __u64 fe_logical;  /* logical offset in bytes for the start of
 
18
                            * the extent from the beginning of the file */
 
19
        __u64 fe_physical; /* physical offset in bytes for the start
 
20
                            * of the extent from the beginning of the disk */
 
21
        __u64 fe_length;   /* length in bytes for this extent */
 
22
        __u64 fe_reserved64[2];
 
23
        __u32 fe_flags;    /* FIEMAP_EXTENT_* flags for this extent */
 
24
        __u32 fe_reserved[3];
 
25
};
 
26
 
 
27
struct fiemap {
 
28
        __u64 fm_start;         /* logical offset (inclusive) at
 
29
                                 * which to start mapping (in) */
 
30
        __u64 fm_length;        /* logical length of mapping which
 
31
                                 * userspace wants (in) */
 
32
        __u32 fm_flags;         /* FIEMAP_FLAG_* flags for request (in/out) */
 
33
        __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
 
34
        __u32 fm_extent_count;  /* size of fm_extents array (in) */
 
35
        __u32 fm_reserved;
 
36
        struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
 
37
};
 
38
 
 
39
#define FIEMAP_MAX_OFFSET       (~0ULL)
 
40
 
 
41
#define FIEMAP_FLAG_SYNC        0x00000001 /* sync file data before map */
 
42
#define FIEMAP_FLAG_XATTR       0x00000002 /* map extended attribute tree */
 
43
 
 
44
#define FIEMAP_FLAGS_COMPAT     (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
 
45
 
 
46
#define FIEMAP_EXTENT_LAST              0x00000001 /* Last extent in file. */
 
47
#define FIEMAP_EXTENT_UNKNOWN           0x00000002 /* Data location unknown. */
 
48
#define FIEMAP_EXTENT_DELALLOC          0x00000004 /* Location still pending.
 
49
                                                    * Sets EXTENT_UNKNOWN. */
 
50
#define FIEMAP_EXTENT_ENCODED           0x00000008 /* Data can not be read
 
51
                                                    * while fs is unmounted */
 
52
#define FIEMAP_EXTENT_DATA_ENCRYPTED    0x00000080 /* Data is encrypted by fs.
 
53
                                                    * Sets EXTENT_NO_BYPASS. */
 
54
#define FIEMAP_EXTENT_NOT_ALIGNED       0x00000100 /* Extent offsets may not be
 
55
                                                    * block aligned. */
 
56
#define FIEMAP_EXTENT_DATA_INLINE       0x00000200 /* Data mixed with metadata.
 
57
                                                    * Sets EXTENT_NOT_ALIGNED.*/
 
58
#define FIEMAP_EXTENT_DATA_TAIL         0x00000400 /* Multiple files in block.
 
59
                                                    * Sets EXTENT_NOT_ALIGNED.*/
 
60
#define FIEMAP_EXTENT_UNWRITTEN         0x00000800 /* Space allocated, but
 
61
                                                    * no data (i.e. zero). */
 
62
#define FIEMAP_EXTENT_MERGED            0x00001000 /* File does not natively
 
63
                                                    * support extents. Result
 
64
                                                    * merged for efficiency. */
 
65
 
 
66
#endif /* _LINUX_FIEMAP_H */