Commit ff784a78 authored by Gao Xiang's avatar Gao Xiang Committed by Greg Kroah-Hartman

staging: erofs: correct all misused ENOTSUPP

As Chao pointed out [1], ENOTSUPP is used for NFS
protocol only, we should use EOPNOTSUPP instead...

[1] https://lore.kernel.org/lkml/108ee2f9-75dd-b8ab-8da7-b81c17bafbf6@huawei.com/Reported-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Link: https://lore.kernel.org/r/20190814103705.60698-3-gaoxiang25@huawei.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 382329a9
...@@ -124,7 +124,7 @@ static int lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out) ...@@ -124,7 +124,7 @@ static int lz4_decompress(struct z_erofs_decompress_req *rq, u8 *out)
int ret; int ret;
if (rq->inputsize > PAGE_SIZE) if (rq->inputsize > PAGE_SIZE)
return -ENOTSUPP; return -EOPNOTSUPP;
src = kmap_atomic(*rq->in); src = kmap_atomic(*rq->in);
inputmargin = 0; inputmargin = 0;
......
...@@ -403,12 +403,12 @@ int z_erofs_map_blocks_iter(struct inode *inode, ...@@ -403,12 +403,12 @@ int z_erofs_map_blocks_iter(struct inode *inode,
struct erofs_map_blocks *map, struct erofs_map_blocks *map,
int flags); int flags);
#else #else
static inline int z_erofs_fill_inode(struct inode *inode) { return -ENOTSUPP; } static inline int z_erofs_fill_inode(struct inode *inode) { return -EOPNOTSUPP; }
static inline int z_erofs_map_blocks_iter(struct inode *inode, static inline int z_erofs_map_blocks_iter(struct inode *inode,
struct erofs_map_blocks *map, struct erofs_map_blocks *map,
int flags) int flags)
{ {
return -ENOTSUPP; return -EOPNOTSUPP;
} }
#endif /* !CONFIG_EROFS_FS_ZIP */ #endif /* !CONFIG_EROFS_FS_ZIP */
...@@ -516,7 +516,7 @@ void *erofs_get_pcpubuf(unsigned int pagenr); ...@@ -516,7 +516,7 @@ void *erofs_get_pcpubuf(unsigned int pagenr);
#else #else
static inline void *erofs_get_pcpubuf(unsigned int pagenr) static inline void *erofs_get_pcpubuf(unsigned int pagenr)
{ {
return ERR_PTR(-ENOTSUPP); return ERR_PTR(-EOPNOTSUPP);
} }
#define erofs_put_pcpubuf(buf) do {} while (0) #define erofs_put_pcpubuf(buf) do {} while (0)
......
...@@ -71,7 +71,7 @@ static int init_inode_xattrs(struct inode *inode) ...@@ -71,7 +71,7 @@ static int init_inode_xattrs(struct inode *inode)
if (vi->xattr_isize == sizeof(struct erofs_xattr_ibody_header)) { if (vi->xattr_isize == sizeof(struct erofs_xattr_ibody_header)) {
errln("xattr_isize %d of nid %llu is not supported yet", errln("xattr_isize %d of nid %llu is not supported yet",
vi->xattr_isize, vi->nid); vi->xattr_isize, vi->nid);
ret = -ENOTSUPP; ret = -EOPNOTSUPP;
goto out_unlock; goto out_unlock;
} else if (vi->xattr_isize < sizeof(struct erofs_xattr_ibody_header)) { } else if (vi->xattr_isize < sizeof(struct erofs_xattr_ibody_header)) {
if (unlikely(vi->xattr_isize)) { if (unlikely(vi->xattr_isize)) {
......
...@@ -74,13 +74,13 @@ static inline int erofs_getxattr(struct inode *inode, int index, ...@@ -74,13 +74,13 @@ static inline int erofs_getxattr(struct inode *inode, int index,
const char *name, void *buffer, const char *name, void *buffer,
size_t buffer_size) size_t buffer_size)
{ {
return -ENOTSUPP; return -EOPNOTSUPP;
} }
static inline ssize_t erofs_listxattr(struct dentry *dentry, static inline ssize_t erofs_listxattr(struct dentry *dentry,
char *buffer, size_t buffer_size) char *buffer, size_t buffer_size)
{ {
return -ENOTSUPP; return -EOPNOTSUPP;
} }
#endif /* !CONFIG_EROFS_FS_XATTR */ #endif /* !CONFIG_EROFS_FS_XATTR */
......
...@@ -68,7 +68,7 @@ static int fill_inode_lazy(struct inode *inode) ...@@ -68,7 +68,7 @@ static int fill_inode_lazy(struct inode *inode)
if (vi->z_algorithmtype[0] >= Z_EROFS_COMPRESSION_MAX) { if (vi->z_algorithmtype[0] >= Z_EROFS_COMPRESSION_MAX) {
errln("unknown compression format %u for nid %llu, please upgrade kernel", errln("unknown compression format %u for nid %llu, please upgrade kernel",
vi->z_algorithmtype[0], vi->nid); vi->z_algorithmtype[0], vi->nid);
err = -ENOTSUPP; err = -EOPNOTSUPP;
goto unmap_done; goto unmap_done;
} }
...@@ -79,7 +79,7 @@ static int fill_inode_lazy(struct inode *inode) ...@@ -79,7 +79,7 @@ static int fill_inode_lazy(struct inode *inode)
if (vi->z_physical_clusterbits[0] != LOG_BLOCK_SIZE) { if (vi->z_physical_clusterbits[0] != LOG_BLOCK_SIZE) {
errln("unsupported physical clusterbits %u for nid %llu, please upgrade kernel", errln("unsupported physical clusterbits %u for nid %llu, please upgrade kernel",
vi->z_physical_clusterbits[0], vi->nid); vi->z_physical_clusterbits[0], vi->nid);
err = -ENOTSUPP; err = -EOPNOTSUPP;
goto unmap_done; goto unmap_done;
} }
...@@ -211,7 +211,7 @@ static int unpack_compacted_index(struct z_erofs_maprecorder *m, ...@@ -211,7 +211,7 @@ static int unpack_compacted_index(struct z_erofs_maprecorder *m,
else if (1 << amortizedshift == 2 && lclusterbits == 12) else if (1 << amortizedshift == 2 && lclusterbits == 12)
vcnt = 16; vcnt = 16;
else else
return -ENOTSUPP; return -EOPNOTSUPP;
encodebits = ((vcnt << amortizedshift) - sizeof(__le32)) * 8 / vcnt; encodebits = ((vcnt << amortizedshift) - sizeof(__le32)) * 8 / vcnt;
base = round_down(eofs, vcnt << amortizedshift); base = round_down(eofs, vcnt << amortizedshift);
...@@ -275,7 +275,7 @@ static int compacted_load_cluster_from_disk(struct z_erofs_maprecorder *m, ...@@ -275,7 +275,7 @@ static int compacted_load_cluster_from_disk(struct z_erofs_maprecorder *m,
int err; int err;
if (lclusterbits != 12) if (lclusterbits != 12)
return -ENOTSUPP; return -EOPNOTSUPP;
if (lcn >= totalidx) if (lcn >= totalidx)
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment