aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-11 16:23:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-11 16:23:48 -0400
commitfd048088306656824958e7783ffcee27e241b361 (patch)
treebe11bebe3bbd2cac88ff27bd3c7450339d21bdc7 /include
parent5c3c4d9b5810c9aabd8c05219c62ca088aa83eb0 (diff)
parent03010a3350301baac2154fa66de925ae2981b7e3 (diff)
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (43 commits) ext4: Rename ext4dev to ext4 ext4: Avoid double dirtying of super block in ext4_put_super() Update ext4 MAINTAINERS file Hook ext4 to the vfs fiemap interface. generic block based fiemap implementation ocfs2: fiemap support vfs: vfs-level fiemap interface ext4: fix xattr deadlock jbd2: Fix buffer head leak when writing the commit block ext4: Add debugging markers that can be used by systemtap jbd2: abort instead of waiting for nonexistent transaction ext4: fix initialization of UNINIT bitmap blocks ext4: Remove old legacy block allocator ext4: Use readahead when reading an inode from the inode table ext4: Improve the documentation for ext4's /proc tunables ext4: Combine proc file handling into a single set of functions ext4: move /proc setup and teardown out of mballoc.c ext4: Don't use 'struct dentry' for internal lookups ext4/jbd2: Avoid WARN() messages when failing to write to the superblock ext4: use percpu data structures for lg_prealloc_list ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fiemap.h64
-rw-r--r--include/linux/fs.h21
-rw-r--r--include/linux/jbd2.h3
-rw-r--r--include/linux/percpu_counter.h12
5 files changed, 92 insertions, 10 deletions
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 80171ee89a22..8120fa1bc235 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -837,6 +837,8 @@ extern void ext3_truncate (struct inode *);
837extern void ext3_set_inode_flags(struct inode *); 837extern void ext3_set_inode_flags(struct inode *);
838extern void ext3_get_inode_flags(struct ext3_inode_info *); 838extern void ext3_get_inode_flags(struct ext3_inode_info *);
839extern void ext3_set_aops(struct inode *inode); 839extern void ext3_set_aops(struct inode *inode);
840extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
841 u64 start, u64 len);
840 842
841/* ioctl.c */ 843/* ioctl.c */
842extern int ext3_ioctl (struct inode *, struct file *, unsigned int, 844extern int ext3_ioctl (struct inode *, struct file *, unsigned int,
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h
new file mode 100644
index 000000000000..671decbd2aeb
--- /dev/null
+++ b/include/linux/fiemap.h
@@ -0,0 +1,64 @@
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
14struct fiemap_extent {
15 __u64 fe_logical; /* logical offset in bytes for the start of
16 * the extent from the beginning of the file */
17 __u64 fe_physical; /* physical offset in bytes for the start
18 * of the extent from the beginning of the disk */
19 __u64 fe_length; /* length in bytes for this extent */
20 __u64 fe_reserved64[2];
21 __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */
22 __u32 fe_reserved[3];
23};
24
25struct fiemap {
26 __u64 fm_start; /* logical offset (inclusive) at
27 * which to start mapping (in) */
28 __u64 fm_length; /* logical length of mapping which
29 * userspace wants (in) */
30 __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */
31 __u32 fm_mapped_extents;/* number of extents that were mapped (out) */
32 __u32 fm_extent_count; /* size of fm_extents array (in) */
33 __u32 fm_reserved;
34 struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */
35};
36
37#define FIEMAP_MAX_OFFSET (~0ULL)
38
39#define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */
40#define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */
41
42#define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR)
43
44#define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */
45#define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */
46#define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending.
47 * Sets EXTENT_UNKNOWN. */
48#define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read
49 * while fs is unmounted */
50#define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs.
51 * Sets EXTENT_NO_BYPASS. */
52#define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be
53 * block aligned. */
54#define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Data mixed with metadata.
55 * Sets EXTENT_NOT_ALIGNED.*/
56#define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Multiple files in block.
57 * Sets EXTENT_NOT_ALIGNED.*/
58#define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but
59 * no data (i.e. zero). */
60#define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively
61 * support extents. Result
62 * merged for efficiency. */
63
64#endif /* _LINUX_FIEMAP_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 32477e8872d5..44e3cb2f1966 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -234,6 +234,7 @@ extern int dir_notify_enable;
234#define FS_IOC_SETFLAGS _IOW('f', 2, long) 234#define FS_IOC_SETFLAGS _IOW('f', 2, long)
235#define FS_IOC_GETVERSION _IOR('v', 1, long) 235#define FS_IOC_GETVERSION _IOR('v', 1, long)
236#define FS_IOC_SETVERSION _IOW('v', 2, long) 236#define FS_IOC_SETVERSION _IOW('v', 2, long)
237#define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap)
237#define FS_IOC32_GETFLAGS _IOR('f', 1, int) 238#define FS_IOC32_GETFLAGS _IOR('f', 1, int)
238#define FS_IOC32_SETFLAGS _IOW('f', 2, int) 239#define FS_IOC32_SETFLAGS _IOW('f', 2, int)
239#define FS_IOC32_GETVERSION _IOR('v', 1, int) 240#define FS_IOC32_GETVERSION _IOR('v', 1, int)
@@ -294,6 +295,7 @@ extern int dir_notify_enable;
294#include <linux/mutex.h> 295#include <linux/mutex.h>
295#include <linux/capability.h> 296#include <linux/capability.h>
296#include <linux/semaphore.h> 297#include <linux/semaphore.h>
298#include <linux/fiemap.h>
297 299
298#include <asm/atomic.h> 300#include <asm/atomic.h>
299#include <asm/byteorder.h> 301#include <asm/byteorder.h>
@@ -1182,6 +1184,20 @@ extern void dentry_unhash(struct dentry *dentry);
1182extern int file_permission(struct file *, int); 1184extern int file_permission(struct file *, int);
1183 1185
1184/* 1186/*
1187 * VFS FS_IOC_FIEMAP helper definitions.
1188 */
1189struct fiemap_extent_info {
1190 unsigned int fi_flags; /* Flags as passed from user */
1191 unsigned int fi_extents_mapped; /* Number of mapped extents */
1192 unsigned int fi_extents_max; /* Size of fiemap_extent array */
1193 struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent
1194 * array */
1195};
1196int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical,
1197 u64 phys, u64 len, u32 flags);
1198int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags);
1199
1200/*
1185 * File types 1201 * File types
1186 * 1202 *
1187 * NOTE! These match bits 12..15 of stat.st_mode 1203 * NOTE! These match bits 12..15 of stat.st_mode
@@ -1290,6 +1306,8 @@ struct inode_operations {
1290 void (*truncate_range)(struct inode *, loff_t, loff_t); 1306 void (*truncate_range)(struct inode *, loff_t, loff_t);
1291 long (*fallocate)(struct inode *inode, int mode, loff_t offset, 1307 long (*fallocate)(struct inode *inode, int mode, loff_t offset,
1292 loff_t len); 1308 loff_t len);
1309 int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start,
1310 u64 len);
1293}; 1311};
1294 1312
1295struct seq_file; 1313struct seq_file;
@@ -1987,6 +2005,9 @@ extern int vfs_fstat(unsigned int, struct kstat *);
1987 2005
1988extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 2006extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
1989 unsigned long arg); 2007 unsigned long arg);
2008extern int generic_block_fiemap(struct inode *inode,
2009 struct fiemap_extent_info *fieinfo, u64 start,
2010 u64 len, get_block_t *get_block);
1990 2011
1991extern void get_filesystem(struct file_system_type *fs); 2012extern void get_filesystem(struct file_system_type *fs);
1992extern void put_filesystem(struct file_system_type *fs); 2013extern void put_filesystem(struct file_system_type *fs);
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 3dd209007098..66c3499478b5 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -850,7 +850,8 @@ struct journal_s
850 */ 850 */
851 struct block_device *j_dev; 851 struct block_device *j_dev;
852 int j_blocksize; 852 int j_blocksize;
853 unsigned long long j_blk_offset; 853 unsigned long long j_blk_offset;
854 char j_devname[BDEVNAME_SIZE+24];
854 855
855 /* 856 /*
856 * Device which holds the client fs. For internal journal this will be 857 * Device which holds the client fs. For internal journal this will be
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 208388835357..9007ccdfc112 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -35,7 +35,7 @@ int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount);
35void percpu_counter_destroy(struct percpu_counter *fbc); 35void percpu_counter_destroy(struct percpu_counter *fbc);
36void percpu_counter_set(struct percpu_counter *fbc, s64 amount); 36void percpu_counter_set(struct percpu_counter *fbc, s64 amount);
37void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); 37void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch);
38s64 __percpu_counter_sum(struct percpu_counter *fbc, int set); 38s64 __percpu_counter_sum(struct percpu_counter *fbc);
39 39
40static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) 40static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
41{ 41{
@@ -44,19 +44,13 @@ static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount)
44 44
45static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) 45static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc)
46{ 46{
47 s64 ret = __percpu_counter_sum(fbc, 0); 47 s64 ret = __percpu_counter_sum(fbc);
48 return ret < 0 ? 0 : ret; 48 return ret < 0 ? 0 : ret;
49} 49}
50 50
51static inline s64 percpu_counter_sum_and_set(struct percpu_counter *fbc)
52{
53 return __percpu_counter_sum(fbc, 1);
54}
55
56
57static inline s64 percpu_counter_sum(struct percpu_counter *fbc) 51static inline s64 percpu_counter_sum(struct percpu_counter *fbc)
58{ 52{
59 return __percpu_counter_sum(fbc, 0); 53 return __percpu_counter_sum(fbc);
60} 54}
61 55
62static inline s64 percpu_counter_read(struct percpu_counter *fbc) 56static inline s64 percpu_counter_read(struct percpu_counter *fbc)