Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

PR for trivial SPL fixes. #686

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion module/spl/spl-generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ hostid_read(uint32_t *hostid)
int error;

file = kobj_open_file(spl_hostid_path);
if (file == (struct _buf *)-1)
if (PTR_ERR(file) == -1)
return (ENOENT);

error = kobj_get_filesize(file, &size);
Expand Down
4 changes: 2 additions & 2 deletions module/spl/spl-kobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ kobj_open_file(const char *name)

file = kmalloc(sizeof (_buf_t), kmem_flags_convert(KM_SLEEP));
if (file == NULL)
return ((_buf_t *)-1UL);
return (ERR_PTR(-1));

if ((rc = vn_open(name, UIO_SYSSPACE, FREAD, 0644, &vp, 0, 0))) {
kfree(file);
return ((_buf_t *)-1UL);
return (ERR_PTR(-1));
}

file->vp = vp;
Expand Down
2 changes: 1 addition & 1 deletion module/spl/spl-kstat.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ kstat_seq_show(struct seq_file *f, void *p)
return (-rc);
}

int
static int
kstat_default_update(kstat_t *ksp, int rw)
{
ASSERT(ksp != NULL);
Expand Down
6 changes: 3 additions & 3 deletions module/spl/spl-vnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,7 @@ vn_file_cache_constructor(void *buf, void *cdrarg, int kmflags)
INIT_LIST_HEAD(&fp->f_list);

return (0);
} /* file_cache_constructor() */
} /* vn_file_cache_constructor() */

static void
vn_file_cache_destructor(void *buf, void *cdrarg)
Expand All @@ -680,7 +680,7 @@ spl_vn_init(void)
vn_file_cache_destructor, NULL, NULL, NULL, 0);

return (0);
} /* vn_init() */
} /* spl_vn_init() */

void
spl_vn_fini(void)
Expand All @@ -703,4 +703,4 @@ spl_vn_fini(void)

kmem_cache_destroy(vn_file_cache);
kmem_cache_destroy(vn_cache);
} /* vn_fini() */
} /* spl_vn_fini() */
4 changes: 2 additions & 2 deletions module/splat/splat-kobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ splat_kobj_test1(struct file *file, void *arg)
struct _buf *f;

f = kobj_open_file(SPLAT_KOBJ_TEST_FILE);
if (f == (struct _buf *)-1) {
if (PTR_ERR(f) == -1) {
splat_vprint(file, SPLAT_KOBJ_TEST1_NAME, "Failed to open "
"test file: %s\n", SPLAT_KOBJ_TEST_FILE);
return -ENOENT;
Expand All @@ -68,7 +68,7 @@ splat_kobj_test2(struct file *file, void *arg)
int rc;

f = kobj_open_file(SPLAT_KOBJ_TEST_FILE);
if (f == (struct _buf *)-1) {
if (PTR_ERR(f) == -1) {
splat_vprint(file, SPLAT_KOBJ_TEST2_NAME, "Failed to open "
"test file: %s\n", SPLAT_KOBJ_TEST_FILE);
return -ENOENT;
Expand Down