Add more functions and types to the LinuxKPI.

MFC after:	1 week
Sponsored by:	Mellanox Technologies
This commit is contained in:
Hans Petter Selasky 2015-11-30 09:24:12 +00:00
parent 36f8b167b5
commit 52ba05767f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=291481
2 changed files with 19 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
* Copyright (c) 2013 Mellanox Technologies, Ltd.
* Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -125,6 +125,21 @@ get_unused_fd(void)
return fd;
}
static inline int
get_unused_fd_flags(int flags)
{
struct file *file;
int error;
int fd;
error = falloc(curthread, &file, &fd, flags);
if (error)
return -error;
/* drop the extra reference */
fdrop(file, curthread);
return fd;
}
static inline struct linux_file *
alloc_file(int mode, const struct file_operations *fops)
{

View File

@ -2,7 +2,7 @@
* Copyright (c) 2010 Isilon Systems, Inc.
* Copyright (c) 2010 iX Systems, Inc.
* Copyright (c) 2010 Panasas, Inc.
* Copyright (c) 2013, 2014 Mellanox Technologies, Ltd.
* Copyright (c) 2013-2015 Mellanox Technologies, Ltd.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@ -48,6 +48,8 @@ struct work_struct {
void (*fn)(struct work_struct *);
};
typedef __typeof(((struct work_struct *)0)->fn) work_func_t;
struct delayed_work {
struct work_struct work;
struct callout timer;