Linux Kernel
3.7.1
|
#include <linux/syscalls.h>
#include <linux/mm.h>
#include <linux/capability.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/security.h>
#include <linux/export.h>
#include <linux/uaccess.h>
#include <linux/writeback.h>
#include <linux/buffer_head.h>
#include <linux/falloc.h>
#include <asm/ioctls.h>
Go to the source code of this file.
Macros | |
#define | FIEMAP_MAX_EXTENTS (UINT_MAX / sizeof(struct fiemap_extent)) |
#define | SET_UNKNOWN_FLAGS (FIEMAP_EXTENT_DELALLOC) |
#define | SET_NO_UNMOUNTED_IO_FLAGS (FIEMAP_EXTENT_DATA_ENCRYPTED) |
#define | SET_NOT_ALIGNED_FLAGS (FIEMAP_EXTENT_DATA_TAIL|FIEMAP_EXTENT_DATA_INLINE) |
Functions | |
int | fiemap_fill_next_extent (struct fiemap_extent_info *fieinfo, u64 logical, u64 phys, u64 len, u32 flags) |
EXPORT_SYMBOL (fiemap_fill_next_extent) | |
int | fiemap_check_flags (struct fiemap_extent_info *fieinfo, u32 fs_flags) |
EXPORT_SYMBOL (fiemap_check_flags) | |
int | ioctl_preallocate (struct file *filp, void __user *argp) |
int | do_vfs_ioctl (struct file *filp, unsigned int fd, unsigned int cmd, unsigned long arg) |
SYSCALL_DEFINE3 (ioctl, unsigned int, fd, unsigned int, cmd, unsigned long, arg) | |
#define FIEMAP_MAX_EXTENTS (UINT_MAX / sizeof(struct fiemap_extent)) |
#define SET_NO_UNMOUNTED_IO_FLAGS (FIEMAP_EXTENT_DATA_ENCRYPTED) |
#define SET_NOT_ALIGNED_FLAGS (FIEMAP_EXTENT_DATA_TAIL|FIEMAP_EXTENT_DATA_INLINE) |
#define SET_UNKNOWN_FLAGS (FIEMAP_EXTENT_DELALLOC) |
fiemap_fill_next_extent - Fiemap helper function : Fiemap context passed into ->fiemap : Extent logical start offset, in bytes : Extent physical start offset, in bytes : Extent length, in bytes : FIEMAP_EXTENT flags that describe this extent
Called from file system ->fiemap callback. Will populate extent info as passed in via arguments and copy to user memory. On success, extent count on fieinfo is incremented.
Returns 0 on success, -errno on error, 1 if this was the last extent that will fit in user array.
EXPORT_SYMBOL | ( | fiemap_fill_next_extent | ) |
EXPORT_SYMBOL | ( | fiemap_check_flags | ) |
int fiemap_check_flags | ( | struct fiemap_extent_info * | fieinfo, |
u32 | fs_flags | ||
) |
fiemap_check_flags - check validity of requested flags for fiemap : Fiemap context passed into ->fiemap : Set of fiemap flags that the file system understands
Called from file system ->fiemap callback. This will compute the intersection of valid fiemap flags and those that the fs supports. That value is then compared against the user supplied flags. In case of bad user flags, the invalid values will be written into the fieinfo structure, and -EBADR is returned, which tells ioctl_fiemap() to return those values to userspace. For this reason, a return code of -EBADR should be preserved.
Returns 0 on success, -EBADR on bad flags.