Tap2Unlock - a new screen wake feature similar to d2w and s2w
But with patterns here
How it works ?
Divide your screen vertically and horizontally , you get four divisions
They are numbered as
          1 | 2
          -----
          3 | 4
The pattern is stored in sysfs file sys/android_touch/tap2unlock_pattern
You tap the right combination to open your screen
Pressing the power button will turn your display on but not the touch sensor.

version 1.0
-Ability - 4 number pattern (will be improved)
-Currently the pattern gets rstored to 1234 after every boot
(This can only be fixed if a kernel mod app provides support for it in the future.)

All copyrights of t2u is reserved with goutamniwas <goutamniwas@gmail.com>
Many credits to showp-1984 for his D2w which made this possible.

Plus: Some of fixed by jollaman999
Try to add Tap2Unlock for our OG
Revert "Try to add Tap2Unlock for our OG"

This reverts commit d8e54710989a1afb223f035d168383ee66d696ae.
Revert "Tap2Unlock - a new screen wake feature similar to d2w and s2w"

This reverts commit 2a25f265749b53258c2646080b26c0c7a803810d.
f2fs: do not make dirty any inmemory pages

This patch let inmemory pages be clean all the time.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: invalidate inmemory page

If user truncates file's data, we should truncate inmemory pages too.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: should truncate any allocated block for inline_data write

When trying to write inline_data, we should truncate any data block allocated
and pointed by the inode block.
We should consider the data index is not 0.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: fix race conditon on truncation with inline_data

Let's consider the following scenario.

blkaddr[0] inline_data i_size  i_blocks writepage           truncate
  NEW        X        4096        2    dirty page #0
  NEW        X         0                                    change i_size
  NEW        X         0          2    f2fs_write_inline_data
  NEW        X         0          2    get_dnode_of_data
  NEW        X         0          2    truncate_data_blocks_range
  NULL       O         0          1    memcpy(inline_data)
  NULL       O         0          1    f2fs_put_dnode
  NULL       O         0          1                         f2fs_truncate
  NULL       O         0          1                         get_dnode_of_data
  NULL       O         0          1                       *invalid block addr*

This patch adds checking inline_data flag during f2fs_truncate not to refer
corrupted block indices.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: use highmem for directory pages

This patch fixes to use highmem for directory pages.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: avoid to allocate when inline_data was written

The sceanrio is like this.
inline_data   i_size     page                 write_begin/vm_page_mkwrite
  X             30       dirty_page
  X             30                            write to #4096 position
  X             30       get_dnode_of_data    wait for get_dnode_of_data
  O             30       write inline_data
  O             30                            get_dnode_of_data
  O             30                            reserve data block
..

In this case, we have #0 = NEW_ADDR and inline_data as well.
We should not allow this condition for further access.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: fix to call f2fs_unlock_op

This patch fixes to call f2fs_unlock_op, which was missing before.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: avoid build warning

This patch removes build warning.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: avoid infinite loop at cp_error

This patch avoids an infinite loop in sync_dirty_inode_page when -EIO was
detected.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: add infra struct and helper for inline dir

This patch defines macro/inline dentry structure, and adds some helpers for
inline dir infrastructure.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: add a new mount option for inline dir

Adds a new mount option 'inline_dentry' for inline dir.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: export dir operations for inline dir

This patch exports some dir operations for inline dir, additionally introduces
f2fs_drop_nlink from f2fs_delete_entry for reusing by inline dir function.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: add key function to handle inline dir

Adds Functions to implement inline dir init/lookup/insert/delete/convert ops.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
[Jaegeuk Kim: remove needless reserved area copy, pointed by Dan Carpenter]
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: enable inline dir handling

Add inline dir functions into normal dir ops' function to handle inline ops.
Besides, we enable inline dir mode when a new dir inode is created if
inline_data option is on.

Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>

Conflicts:
	fs/f2fs/dir.c
f2fs: reuse room_for_filename for inline dentry operation

This patch introduces to reuse the existing room_for_filename for inline dentry
operation.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: reuse find_in_block code for find_in_inline_dir

This patch removes redundant copied code in find_in_inline_dir.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>