f2fs: use macro for code readability

This patch introduces DEF_NIDS_PER_INODE/GET_ORPHAN_BLOCKS/F2FS_CP_PACKS macro
instead of numbers in code for readability.

change log from v1:
 o fix typo pointed out by Jaegeuk Kim.

Change-Id: Ie83ad6b4e3cac5d8cbc1b7c1143d75c786a9176c
Signed-off-by: Chao Yu <chao2.yu@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: truncate stale block for inline_data

This verifies to truncate any allocated blocks, offset[0], by inline_data.
Not figured out, but for making sure.

Change-Id: I31e77ab414984c29a44c6ccea279d91129a9808c
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: simplify by using a literal

We can make the code a bit simpler because we know that "!retry" is
zero.

Change-Id: Iddafa780aeb616f588183f75a7183b97c16752f7
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
f2fs: fix wrong casting for dentry name

The dentry name type is unsigned char *.
If we don't match this type, some character codes can be changed by signed bit.

Change-Id: Ia7800ed8cf37a4c87808b49e8fedd1c4863ee584
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
net: guard tcp_set_keepalive() to tcp sockets

Its possible to use RAW sockets to get a crash in
tcp_set_keepalive() / sk_reset_timer()

Fix is to make sure socket is a SOCK_STREAM one.

Change-Id: Ieeb498a3e623cfcb54e1c865a3c0229e4acf1e87
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>