]> Git Repo - linux.git/commitdiff
erofs: update erofs_inode_is_data_compressed helper
authorGao Xiang <[email protected]>
Wed, 4 Sep 2019 02:08:52 +0000 (10:08 +0800)
committerGreg Kroah-Hartman <[email protected]>
Thu, 5 Sep 2019 18:10:07 +0000 (20:10 +0200)
As Christoph said, "This looks like a really obsfucated
way to write:
return datamode == EROFS_INODE_FLAT_COMPRESSION ||
datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY; "

Although I had my own consideration, it's the right way for now.

[1] https://lore.kernel.org/r/20190829095954[email protected]/
Reported-by: Christoph Hellwig <[email protected]>
Signed-off-by: Gao Xiang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
fs/erofs/erofs_fs.h

index 59dcc2e8cb02fca8868e729bd7eeafc95186deb1..87d7ae82339a430f3d2bc109d71d0c3fbe54c0ee 100644 (file)
@@ -62,9 +62,8 @@ enum {
 
 static inline bool erofs_inode_is_data_compressed(unsigned int datamode)
 {
-       if (datamode == EROFS_INODE_FLAT_COMPRESSION)
-               return true;
-       return datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY;
+       return datamode == EROFS_INODE_FLAT_COMPRESSION ||
+               datamode == EROFS_INODE_FLAT_COMPRESSION_LEGACY;
 }
 
 /* bit definitions of inode i_advise */
This page took 0.056449 seconds and 4 git commands to generate.