diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 13:26:37 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-27 13:26:37 -0400 |
commit | e4ce30f3779c2ddaa7dfaa4042209e5dbacbada5 (patch) | |
tree | cc64c1dcd16b5dbf71ebc8338b339e6fb04abaee /include | |
parent | b899ebeb05da4287ce845976727e3e83dadd25d5 (diff) | |
parent | 14ece1028b3ed53ffec1b1213ffc6acaf79ad77c (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: (40 commits)
ext4: Make fsync sync new parent directories in no-journal mode
ext4: Drop whitespace at end of lines
ext4: Fix compat EXT4_IOC_ADD_GROUP
ext4: Conditionally define compat ioctl numbers
tracing: Convert more ext4 events to DEFINE_EVENT
ext4: Add new tracepoints to track mballoc's buddy bitmap loads
ext4: Add a missing trace hook
ext4: restart ext4_ext_remove_space() after transaction restart
ext4: Clear the EXT4_EOFBLOCKS_FL flag only when warranted
ext4: Avoid crashing on NULL ptr dereference on a filesystem error
ext4: Use bitops to read/modify i_flags in struct ext4_inode_info
ext4: Convert calls of ext4_error() to EXT4_ERROR_INODE()
ext4: Convert callers of ext4_get_blocks() to use ext4_map_blocks()
ext4: Add new abstraction ext4_map_blocks() underneath ext4_get_blocks()
ext4: Use our own write_cache_pages()
ext4: Show journal_checksum option
ext4: Fix for ext4_mb_collect_stats()
ext4: check for a good block group before loading buddy pages
ext4: Prevent creation of files larger than RLIMIT_FSIZE using fallocate
ext4: Remove extraneous newlines in ext4_msg() calls
...
Fixed up trivial conflict in fs/ext4/fsync.c
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/quotaops.h | 37 | ||||
-rw-r--r-- | include/trace/events/ext4.h | 94 |
2 files changed, 76 insertions, 55 deletions
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 370abb1e99cb..e38ae53f3529 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -9,6 +9,10 @@ | |||
9 | 9 | ||
10 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
11 | 11 | ||
12 | #define DQUOT_SPACE_WARN 0x1 | ||
13 | #define DQUOT_SPACE_RESERVE 0x2 | ||
14 | #define DQUOT_SPACE_NOFAIL 0x4 | ||
15 | |||
12 | static inline struct quota_info *sb_dqopt(struct super_block *sb) | 16 | static inline struct quota_info *sb_dqopt(struct super_block *sb) |
13 | { | 17 | { |
14 | return &sb->s_dquot; | 18 | return &sb->s_dquot; |
@@ -41,9 +45,8 @@ int dquot_scan_active(struct super_block *sb, | |||
41 | struct dquot *dquot_alloc(struct super_block *sb, int type); | 45 | struct dquot *dquot_alloc(struct super_block *sb, int type); |
42 | void dquot_destroy(struct dquot *dquot); | 46 | void dquot_destroy(struct dquot *dquot); |
43 | 47 | ||
44 | int __dquot_alloc_space(struct inode *inode, qsize_t number, | 48 | int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags); |
45 | int warn, int reserve); | 49 | void __dquot_free_space(struct inode *inode, qsize_t number, int flags); |
46 | void __dquot_free_space(struct inode *inode, qsize_t number, int reserve); | ||
47 | 50 | ||
48 | int dquot_alloc_inode(const struct inode *inode); | 51 | int dquot_alloc_inode(const struct inode *inode); |
49 | 52 | ||
@@ -242,17 +245,17 @@ static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) | |||
242 | } | 245 | } |
243 | 246 | ||
244 | static inline int __dquot_alloc_space(struct inode *inode, qsize_t number, | 247 | static inline int __dquot_alloc_space(struct inode *inode, qsize_t number, |
245 | int warn, int reserve) | 248 | int flags) |
246 | { | 249 | { |
247 | if (!reserve) | 250 | if (!(flags & DQUOT_SPACE_RESERVE)) |
248 | inode_add_bytes(inode, number); | 251 | inode_add_bytes(inode, number); |
249 | return 0; | 252 | return 0; |
250 | } | 253 | } |
251 | 254 | ||
252 | static inline void __dquot_free_space(struct inode *inode, qsize_t number, | 255 | static inline void __dquot_free_space(struct inode *inode, qsize_t number, |
253 | int reserve) | 256 | int flags) |
254 | { | 257 | { |
255 | if (!reserve) | 258 | if (!(flags & DQUOT_SPACE_RESERVE)) |
256 | inode_sub_bytes(inode, number); | 259 | inode_sub_bytes(inode, number); |
257 | } | 260 | } |
258 | 261 | ||
@@ -268,7 +271,13 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) | |||
268 | 271 | ||
269 | static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) | 272 | static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) |
270 | { | 273 | { |
271 | return __dquot_alloc_space(inode, nr, 1, 0); | 274 | return __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN); |
275 | } | ||
276 | |||
277 | static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr) | ||
278 | { | ||
279 | __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL); | ||
280 | mark_inode_dirty(inode); | ||
272 | } | 281 | } |
273 | 282 | ||
274 | static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) | 283 | static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) |
@@ -286,6 +295,11 @@ static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr) | |||
286 | return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits); | 295 | return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits); |
287 | } | 296 | } |
288 | 297 | ||
298 | static inline void dquot_alloc_block_nofail(struct inode *inode, qsize_t nr) | ||
299 | { | ||
300 | dquot_alloc_space_nofail(inode, nr << inode->i_blkbits); | ||
301 | } | ||
302 | |||
289 | static inline int dquot_alloc_block(struct inode *inode, qsize_t nr) | 303 | static inline int dquot_alloc_block(struct inode *inode, qsize_t nr) |
290 | { | 304 | { |
291 | return dquot_alloc_space(inode, nr << inode->i_blkbits); | 305 | return dquot_alloc_space(inode, nr << inode->i_blkbits); |
@@ -293,7 +307,7 @@ static inline int dquot_alloc_block(struct inode *inode, qsize_t nr) | |||
293 | 307 | ||
294 | static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr) | 308 | static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr) |
295 | { | 309 | { |
296 | return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0, 0); | 310 | return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0); |
297 | } | 311 | } |
298 | 312 | ||
299 | static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) | 313 | static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) |
@@ -308,7 +322,8 @@ static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) | |||
308 | 322 | ||
309 | static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) | 323 | static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) |
310 | { | 324 | { |
311 | return __dquot_alloc_space(inode, nr << inode->i_blkbits, 1, 1); | 325 | return __dquot_alloc_space(inode, nr << inode->i_blkbits, |
326 | DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE); | ||
312 | } | 327 | } |
313 | 328 | ||
314 | static inline int dquot_claim_block(struct inode *inode, qsize_t nr) | 329 | static inline int dquot_claim_block(struct inode *inode, qsize_t nr) |
@@ -345,7 +360,7 @@ static inline void dquot_free_block(struct inode *inode, qsize_t nr) | |||
345 | static inline void dquot_release_reservation_block(struct inode *inode, | 360 | static inline void dquot_release_reservation_block(struct inode *inode, |
346 | qsize_t nr) | 361 | qsize_t nr) |
347 | { | 362 | { |
348 | __dquot_free_space(inode, nr << inode->i_blkbits, 1); | 363 | __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE); |
349 | } | 364 | } |
350 | 365 | ||
351 | #endif /* _LINUX_QUOTAOPS_ */ | 366 | #endif /* _LINUX_QUOTAOPS_ */ |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index 2aa6aa3e8f61..5d60ad4ebf78 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -353,7 +353,7 @@ TRACE_EVENT(ext4_discard_blocks, | |||
353 | jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) | 353 | jbd2_dev_to_name(__entry->dev), __entry->blk, __entry->count) |
354 | ); | 354 | ); |
355 | 355 | ||
356 | TRACE_EVENT(ext4_mb_new_inode_pa, | 356 | DECLARE_EVENT_CLASS(ext4__mb_new_pa, |
357 | TP_PROTO(struct ext4_allocation_context *ac, | 357 | TP_PROTO(struct ext4_allocation_context *ac, |
358 | struct ext4_prealloc_space *pa), | 358 | struct ext4_prealloc_space *pa), |
359 | 359 | ||
@@ -381,32 +381,20 @@ TRACE_EVENT(ext4_mb_new_inode_pa, | |||
381 | __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) | 381 | __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) |
382 | ); | 382 | ); |
383 | 383 | ||
384 | TRACE_EVENT(ext4_mb_new_group_pa, | 384 | DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_inode_pa, |
385 | |||
385 | TP_PROTO(struct ext4_allocation_context *ac, | 386 | TP_PROTO(struct ext4_allocation_context *ac, |
386 | struct ext4_prealloc_space *pa), | 387 | struct ext4_prealloc_space *pa), |
387 | 388 | ||
388 | TP_ARGS(ac, pa), | 389 | TP_ARGS(ac, pa) |
389 | 390 | ); | |
390 | TP_STRUCT__entry( | ||
391 | __field( dev_t, dev ) | ||
392 | __field( ino_t, ino ) | ||
393 | __field( __u64, pa_pstart ) | ||
394 | __field( __u32, pa_len ) | ||
395 | __field( __u64, pa_lstart ) | ||
396 | 391 | ||
397 | ), | 392 | DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa, |
398 | 393 | ||
399 | TP_fast_assign( | 394 | TP_PROTO(struct ext4_allocation_context *ac, |
400 | __entry->dev = ac->ac_sb->s_dev; | 395 | struct ext4_prealloc_space *pa), |
401 | __entry->ino = ac->ac_inode->i_ino; | ||
402 | __entry->pa_pstart = pa->pa_pstart; | ||
403 | __entry->pa_len = pa->pa_len; | ||
404 | __entry->pa_lstart = pa->pa_lstart; | ||
405 | ), | ||
406 | 396 | ||
407 | TP_printk("dev %s ino %lu pstart %llu len %u lstart %llu", | 397 | TP_ARGS(ac, pa) |
408 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
409 | __entry->pa_pstart, __entry->pa_len, __entry->pa_lstart) | ||
410 | ); | 398 | ); |
411 | 399 | ||
412 | TRACE_EVENT(ext4_mb_release_inode_pa, | 400 | TRACE_EVENT(ext4_mb_release_inode_pa, |
@@ -790,7 +778,7 @@ TRACE_EVENT(ext4_mballoc_prealloc, | |||
790 | __entry->result_len, __entry->result_logical) | 778 | __entry->result_len, __entry->result_logical) |
791 | ); | 779 | ); |
792 | 780 | ||
793 | TRACE_EVENT(ext4_mballoc_discard, | 781 | DECLARE_EVENT_CLASS(ext4__mballoc, |
794 | TP_PROTO(struct ext4_allocation_context *ac), | 782 | TP_PROTO(struct ext4_allocation_context *ac), |
795 | 783 | ||
796 | TP_ARGS(ac), | 784 | TP_ARGS(ac), |
@@ -819,33 +807,18 @@ TRACE_EVENT(ext4_mballoc_discard, | |||
819 | __entry->result_len, __entry->result_logical) | 807 | __entry->result_len, __entry->result_logical) |
820 | ); | 808 | ); |
821 | 809 | ||
822 | TRACE_EVENT(ext4_mballoc_free, | 810 | DEFINE_EVENT(ext4__mballoc, ext4_mballoc_discard, |
811 | |||
823 | TP_PROTO(struct ext4_allocation_context *ac), | 812 | TP_PROTO(struct ext4_allocation_context *ac), |
824 | 813 | ||
825 | TP_ARGS(ac), | 814 | TP_ARGS(ac) |
815 | ); | ||
826 | 816 | ||
827 | TP_STRUCT__entry( | 817 | DEFINE_EVENT(ext4__mballoc, ext4_mballoc_free, |
828 | __field( dev_t, dev ) | ||
829 | __field( ino_t, ino ) | ||
830 | __field( __u32, result_logical ) | ||
831 | __field( int, result_start ) | ||
832 | __field( __u32, result_group ) | ||
833 | __field( int, result_len ) | ||
834 | ), | ||
835 | 818 | ||
836 | TP_fast_assign( | 819 | TP_PROTO(struct ext4_allocation_context *ac), |
837 | __entry->dev = ac->ac_inode->i_sb->s_dev; | ||
838 | __entry->ino = ac->ac_inode->i_ino; | ||
839 | __entry->result_logical = ac->ac_b_ex.fe_logical; | ||
840 | __entry->result_start = ac->ac_b_ex.fe_start; | ||
841 | __entry->result_group = ac->ac_b_ex.fe_group; | ||
842 | __entry->result_len = ac->ac_b_ex.fe_len; | ||
843 | ), | ||
844 | 820 | ||
845 | TP_printk("dev %s inode %lu extent %u/%d/%u@%u ", | 821 | TP_ARGS(ac) |
846 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
847 | __entry->result_group, __entry->result_start, | ||
848 | __entry->result_len, __entry->result_logical) | ||
849 | ); | 822 | ); |
850 | 823 | ||
851 | TRACE_EVENT(ext4_forget, | 824 | TRACE_EVENT(ext4_forget, |
@@ -974,6 +947,39 @@ TRACE_EVENT(ext4_da_release_space, | |||
974 | __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) | 947 | __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) |
975 | ); | 948 | ); |
976 | 949 | ||
950 | DECLARE_EVENT_CLASS(ext4__bitmap_load, | ||
951 | TP_PROTO(struct super_block *sb, unsigned long group), | ||
952 | |||
953 | TP_ARGS(sb, group), | ||
954 | |||
955 | TP_STRUCT__entry( | ||
956 | __field( dev_t, dev ) | ||
957 | __field( __u32, group ) | ||
958 | |||
959 | ), | ||
960 | |||
961 | TP_fast_assign( | ||
962 | __entry->dev = sb->s_dev; | ||
963 | __entry->group = group; | ||
964 | ), | ||
965 | |||
966 | TP_printk("dev %s group %u", | ||
967 | jbd2_dev_to_name(__entry->dev), __entry->group) | ||
968 | ); | ||
969 | |||
970 | DEFINE_EVENT(ext4__bitmap_load, ext4_mb_bitmap_load, | ||
971 | |||
972 | TP_PROTO(struct super_block *sb, unsigned long group), | ||
973 | |||
974 | TP_ARGS(sb, group) | ||
975 | ); | ||
976 | |||
977 | DEFINE_EVENT(ext4__bitmap_load, ext4_mb_buddy_bitmap_load, | ||
978 | |||
979 | TP_PROTO(struct super_block *sb, unsigned long group), | ||
980 | |||
981 | TP_ARGS(sb, group) | ||
982 | ); | ||
977 | 983 | ||
978 | #endif /* _TRACE_EXT4_H */ | 984 | #endif /* _TRACE_EXT4_H */ |
979 | 985 | ||