f2fs: don't reserve additional space in xattr block
authorChao Yu <yuchao0@huawei.com>
Thu, 23 Mar 2017 05:38:26 +0000 (13:38 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Fri, 24 Mar 2017 19:10:53 +0000 (15:10 -0400)
commit22588f8773f687449ce6e97dce9f102553440d30
tree4b3fe264daaf5151bf5d3b6dd509f155ff73a4a1
parent89e9eabd7ded4680f3b0f8ddc7398a3909de57c8
f2fs: don't reserve additional space in xattr block

In this patch, we change xattr block disk layout as below:

Before:
xattr node block layout
+---------------------------------------------+---------------+-------------+
|           node block xattr entries          |   reserved    | node footer |
|                  4068 Bytes                 |    4 Bytes    |  24 Bytes   |

In memory layout
+--------------------+---------------------------------+--------------------+
|    inline xattr    |     node block xattr entries    |      reserved      |
|     200 Bytes      |         4068 Bytes              |      4 Bytes       |

After:
xattr node block layout
+-------------------------------------------------------------+-------------+
|                  node block xattr entries                   | node footer |
|                         4072 Bytes                          |  24 Bytes   |

In memory layout
+--------------------+---------------------------------+--------------------+
|    inline xattr    |     node block xattr entries    |      reserved      |
|     200 Bytes      |         4072 Bytes              |      4 Bytes       |

With this change, we don't need to reserve additional space in node block,
just keep reserved space in logical in-memory layout. So that it would help
to enlarge valid free space of xattr node block.

As tested, generic/026 shows max stored xattr entires number increases from
531 to 532 when inline_xattr option is enabled.

Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/xattr.c
fs/f2fs/xattr.h