aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 22:11:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-09 22:11:44 -0400
commit64b2d1fbbfda07765dae3f601862796a61b2c451 (patch)
tree67947ede8fc007a9f0925e697a302a02bd087032 /include
parentb1cce8032f6abe900b078d24f3c3938726528f97 (diff)
parent9ab701349247368f9d57a993b95a5bb05bb37e10 (diff)
Merge tag 'for-f2fs-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs
Pull f2fs updates from Jaegeuk Kim: "In this round, there is no special interesting feature, but we've investigated a couple of tuning points with respect to the I/O flow. Several major bug fixes and a bunch of clean-ups also have been made. This patch-set includes the following major enhancement patches: - enhance wait_on_page_writeback - support SEEK_DATA and SEEK_HOLE - enhance readahead flows - enhance IO flushes - support fiemap - add some tracepoints The other bug fixes are as follows: - fix to support a large volume > 2TB correctly - recovery bug fix wrt fallocated space - fix recursive lock on xattr operations - fix some cases on the remount flow And, there are a bunch of cleanups" * tag 'for-f2fs-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs: (52 commits) f2fs: support f2fs_fiemap f2fs: avoid not to call remove_dirty_inode f2fs: recover fallocated space f2fs: fix to recover data written by dio f2fs: large volume support f2fs: avoid crash when trace f2fs_submit_page_mbio event in ra_sum_pages f2fs: avoid overflow when large directory feathure is enabled f2fs: fix recursive lock by f2fs_setxattr MAINTAINERS: add a co-maintainer from samsung for F2FS MAINTAINERS: change the email address for f2fs f2fs: use inode_init_owner() to simplify codes f2fs: avoid to use slab memory in f2fs_issue_flush for efficiency f2fs: add a tracepoint for f2fs_read_data_page f2fs: add a tracepoint for f2fs_write_{meta,node,data}_pages f2fs: add a tracepoint for f2fs_write_{meta,node,data}_page f2fs: add a tracepoint for f2fs_write_end f2fs: add a tracepoint for f2fs_write_begin f2fs: fix checkpatch warning f2fs: deactivate inode page if the inode is evicted f2fs: decrease the lock granularity during write_begin ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/f2fs_fs.h8
-rw-r--r--include/trace/events/f2fs.h146
2 files changed, 152 insertions, 2 deletions
diff --git a/include/linux/f2fs_fs.h b/include/linux/f2fs_fs.h
index df53e1753a76..6ff0b0b42d47 100644
--- a/include/linux/f2fs_fs.h
+++ b/include/linux/f2fs_fs.h
@@ -19,6 +19,7 @@
19#define F2FS_LOG_SECTORS_PER_BLOCK 3 /* 4KB: F2FS_BLKSIZE */ 19#define F2FS_LOG_SECTORS_PER_BLOCK 3 /* 4KB: F2FS_BLKSIZE */
20#define F2FS_BLKSIZE 4096 /* support only 4KB block */ 20#define F2FS_BLKSIZE 4096 /* support only 4KB block */
21#define F2FS_MAX_EXTENSION 64 /* # of extension entries */ 21#define F2FS_MAX_EXTENSION 64 /* # of extension entries */
22#define F2FS_BLK_ALIGN(x) (((x) + F2FS_BLKSIZE - 1) / F2FS_BLKSIZE)
22 23
23#define NULL_ADDR ((block_t)0) /* used as block_t addresses */ 24#define NULL_ADDR ((block_t)0) /* used as block_t addresses */
24#define NEW_ADDR ((block_t)-1) /* used as block_t addresses */ 25#define NEW_ADDR ((block_t)-1) /* used as block_t addresses */
@@ -75,6 +76,7 @@ struct f2fs_super_block {
75 __le16 volume_name[512]; /* volume name */ 76 __le16 volume_name[512]; /* volume name */
76 __le32 extension_count; /* # of extensions below */ 77 __le32 extension_count; /* # of extensions below */
77 __u8 extension_list[F2FS_MAX_EXTENSION][8]; /* extension array */ 78 __u8 extension_list[F2FS_MAX_EXTENSION][8]; /* extension array */
79 __le32 cp_payload;
78} __packed; 80} __packed;
79 81
80/* 82/*
@@ -146,6 +148,9 @@ struct f2fs_extent {
146#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */ 148#define ADDRS_PER_BLOCK 1018 /* Address Pointers in a Direct Block */
147#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */ 149#define NIDS_PER_BLOCK 1018 /* Node IDs in an Indirect Block */
148 150
151#define ADDRS_PER_PAGE(page, fi) \
152 (IS_INODE(page) ? ADDRS_PER_INODE(fi) : ADDRS_PER_BLOCK)
153
149#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1) 154#define NODE_DIR1_BLOCK (DEF_ADDRS_PER_INODE + 1)
150#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2) 155#define NODE_DIR2_BLOCK (DEF_ADDRS_PER_INODE + 2)
151#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3) 156#define NODE_IND1_BLOCK (DEF_ADDRS_PER_INODE + 3)
@@ -391,6 +396,9 @@ typedef __le32 f2fs_hash_t;
391/* MAX level for dir lookup */ 396/* MAX level for dir lookup */
392#define MAX_DIR_HASH_DEPTH 63 397#define MAX_DIR_HASH_DEPTH 63
393 398
399/* MAX buckets in one level of dir */
400#define MAX_DIR_BUCKETS (1 << ((MAX_DIR_HASH_DEPTH / 2) - 1))
401
394#define SIZE_OF_DIR_ENTRY 11 /* by byte */ 402#define SIZE_OF_DIR_ENTRY 11 /* by byte */
395#define SIZE_OF_DENTRY_BITMAP ((NR_DENTRY_IN_BLOCK + BITS_PER_BYTE - 1) / \ 403#define SIZE_OF_DENTRY_BITMAP ((NR_DENTRY_IN_BLOCK + BITS_PER_BYTE - 1) / \
396 BITS_PER_BYTE) 404 BITS_PER_BYTE)
diff --git a/include/trace/events/f2fs.h b/include/trace/events/f2fs.h
index 67f38faac589..b983990b4a9f 100644
--- a/include/trace/events/f2fs.h
+++ b/include/trace/events/f2fs.h
@@ -659,6 +659,66 @@ DEFINE_EVENT_CONDITION(f2fs__submit_bio, f2fs_submit_read_bio,
659 TP_CONDITION(bio) 659 TP_CONDITION(bio)
660); 660);
661 661
662TRACE_EVENT(f2fs_write_begin,
663
664 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
665 unsigned int flags),
666
667 TP_ARGS(inode, pos, len, flags),
668
669 TP_STRUCT__entry(
670 __field(dev_t, dev)
671 __field(ino_t, ino)
672 __field(loff_t, pos)
673 __field(unsigned int, len)
674 __field(unsigned int, flags)
675 ),
676
677 TP_fast_assign(
678 __entry->dev = inode->i_sb->s_dev;
679 __entry->ino = inode->i_ino;
680 __entry->pos = pos;
681 __entry->len = len;
682 __entry->flags = flags;
683 ),
684
685 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, flags = %u",
686 show_dev_ino(__entry),
687 (unsigned long long)__entry->pos,
688 __entry->len,
689 __entry->flags)
690);
691
692TRACE_EVENT(f2fs_write_end,
693
694 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
695 unsigned int copied),
696
697 TP_ARGS(inode, pos, len, copied),
698
699 TP_STRUCT__entry(
700 __field(dev_t, dev)
701 __field(ino_t, ino)
702 __field(loff_t, pos)
703 __field(unsigned int, len)
704 __field(unsigned int, copied)
705 ),
706
707 TP_fast_assign(
708 __entry->dev = inode->i_sb->s_dev;
709 __entry->ino = inode->i_ino;
710 __entry->pos = pos;
711 __entry->len = len;
712 __entry->copied = copied;
713 ),
714
715 TP_printk("dev = (%d,%d), ino = %lu, pos = %llu, len = %u, copied = %u",
716 show_dev_ino(__entry),
717 (unsigned long long)__entry->pos,
718 __entry->len,
719 __entry->copied)
720);
721
662DECLARE_EVENT_CLASS(f2fs__page, 722DECLARE_EVENT_CLASS(f2fs__page,
663 723
664 TP_PROTO(struct page *page, int type), 724 TP_PROTO(struct page *page, int type),
@@ -672,6 +732,7 @@ DECLARE_EVENT_CLASS(f2fs__page,
672 __field(int, dir) 732 __field(int, dir)
673 __field(pgoff_t, index) 733 __field(pgoff_t, index)
674 __field(int, dirty) 734 __field(int, dirty)
735 __field(int, uptodate)
675 ), 736 ),
676 737
677 TP_fast_assign( 738 TP_fast_assign(
@@ -681,14 +742,31 @@ DECLARE_EVENT_CLASS(f2fs__page,
681 __entry->dir = S_ISDIR(page->mapping->host->i_mode); 742 __entry->dir = S_ISDIR(page->mapping->host->i_mode);
682 __entry->index = page->index; 743 __entry->index = page->index;
683 __entry->dirty = PageDirty(page); 744 __entry->dirty = PageDirty(page);
745 __entry->uptodate = PageUptodate(page);
684 ), 746 ),
685 747
686 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, dirty = %d", 748 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, index = %lu, "
749 "dirty = %d, uptodate = %d",
687 show_dev_ino(__entry), 750 show_dev_ino(__entry),
688 show_block_type(__entry->type), 751 show_block_type(__entry->type),
689 show_file_type(__entry->dir), 752 show_file_type(__entry->dir),
690 (unsigned long)__entry->index, 753 (unsigned long)__entry->index,
691 __entry->dirty) 754 __entry->dirty,
755 __entry->uptodate)
756);
757
758DEFINE_EVENT(f2fs__page, f2fs_writepage,
759
760 TP_PROTO(struct page *page, int type),
761
762 TP_ARGS(page, type)
763);
764
765DEFINE_EVENT(f2fs__page, f2fs_readpage,
766
767 TP_PROTO(struct page *page, int type),
768
769 TP_ARGS(page, type)
692); 770);
693 771
694DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty, 772DEFINE_EVENT(f2fs__page, f2fs_set_page_dirty,
@@ -705,6 +783,70 @@ DEFINE_EVENT(f2fs__page, f2fs_vm_page_mkwrite,
705 TP_ARGS(page, type) 783 TP_ARGS(page, type)
706); 784);
707 785
786TRACE_EVENT(f2fs_writepages,
787
788 TP_PROTO(struct inode *inode, struct writeback_control *wbc, int type),
789
790 TP_ARGS(inode, wbc, type),
791
792 TP_STRUCT__entry(
793 __field(dev_t, dev)
794 __field(ino_t, ino)
795 __field(int, type)
796 __field(int, dir)
797 __field(long, nr_to_write)
798 __field(long, pages_skipped)
799 __field(loff_t, range_start)
800 __field(loff_t, range_end)
801 __field(pgoff_t, writeback_index)
802 __field(int, sync_mode)
803 __field(char, for_kupdate)
804 __field(char, for_background)
805 __field(char, tagged_writepages)
806 __field(char, for_reclaim)
807 __field(char, range_cyclic)
808 __field(char, for_sync)
809 ),
810
811 TP_fast_assign(
812 __entry->dev = inode->i_sb->s_dev;
813 __entry->ino = inode->i_ino;
814 __entry->type = type;
815 __entry->dir = S_ISDIR(inode->i_mode);
816 __entry->nr_to_write = wbc->nr_to_write;
817 __entry->pages_skipped = wbc->pages_skipped;
818 __entry->range_start = wbc->range_start;
819 __entry->range_end = wbc->range_end;
820 __entry->writeback_index = inode->i_mapping->writeback_index;
821 __entry->sync_mode = wbc->sync_mode;
822 __entry->for_kupdate = wbc->for_kupdate;
823 __entry->for_background = wbc->for_background;
824 __entry->tagged_writepages = wbc->tagged_writepages;
825 __entry->for_reclaim = wbc->for_reclaim;
826 __entry->range_cyclic = wbc->range_cyclic;
827 __entry->for_sync = wbc->for_sync;
828 ),
829
830 TP_printk("dev = (%d,%d), ino = %lu, %s, %s, nr_to_write %ld, "
831 "skipped %ld, start %lld, end %lld, wb_idx %lu, sync_mode %d, "
832 "kupdate %u background %u tagged %u reclaim %u cyclic %u sync %u",
833 show_dev_ino(__entry),
834 show_block_type(__entry->type),
835 show_file_type(__entry->dir),
836 __entry->nr_to_write,
837 __entry->pages_skipped,
838 __entry->range_start,
839 __entry->range_end,
840 (unsigned long)__entry->writeback_index,
841 __entry->sync_mode,
842 __entry->for_kupdate,
843 __entry->for_background,
844 __entry->tagged_writepages,
845 __entry->for_reclaim,
846 __entry->range_cyclic,
847 __entry->for_sync)
848);
849
708TRACE_EVENT(f2fs_submit_page_mbio, 850TRACE_EVENT(f2fs_submit_page_mbio,
709 851
710 TP_PROTO(struct page *page, int rw, int type, block_t blk_addr), 852 TP_PROTO(struct page *page, int rw, int type, block_t blk_addr),