mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-24 03:08:51 +03:00
Use SET_ERROR for constant non-zero return codes
Update many return and assignment statements to follow the convention of using the SET_ERROR macro when returning a hard-coded non-zero value from a function. This aids debugging by recording the error codes in the debug log. Reviewed-by: George Melikov <mail@gmelikov.ru> Reviewed-by: Giuseppe Di Natale <dinatale2@llnl.gov> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed by: Matthew Ahrens <mahrens@delphix.com> Signed-off-by: Ned Bass <bass6@llnl.gov> Closes #6441
This commit is contained in:
committed by
Brian Behlendorf
parent
6710381680
commit
ecb2b7dc7f
+2
-2
@@ -578,7 +578,7 @@ zfs_zevent_minor_to_state(minor_t minor, zfs_zevent_t **ze)
|
||||
{
|
||||
*ze = zfsdev_get_state(minor, ZST_ZEVENT);
|
||||
if (*ze == NULL)
|
||||
return (EBADF);
|
||||
return (SET_ERROR(EBADF));
|
||||
|
||||
return (0);
|
||||
}
|
||||
@@ -591,7 +591,7 @@ zfs_zevent_fd_hold(int fd, minor_t *minorp, zfs_zevent_t **ze)
|
||||
|
||||
fp = getf(fd);
|
||||
if (fp == NULL)
|
||||
return (EBADF);
|
||||
return (SET_ERROR(EBADF));
|
||||
|
||||
error = zfsdev_getminor(fp->f_file, minorp);
|
||||
if (error == 0)
|
||||
|
||||
Reference in New Issue
Block a user