Author: hselasky
Date: Mon Nov 30 09:24:12 2015
New Revision: 291481
URL: https://svnweb.freebsd.org/changeset/base/291481

Log:
  Add more functions and types to the LinuxKPI.
  
  MFC after:    1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/compat/linuxkpi/common/include/linux/file.h
  head/sys/compat/linuxkpi/common/include/linux/workqueue.h

Modified: head/sys/compat/linuxkpi/common/include/linux/file.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/file.h        Mon Nov 30 
09:13:04 2015        (r291480)
+++ head/sys/compat/linuxkpi/common/include/linux/file.h        Mon Nov 30 
09:24:12 2015        (r291481)
@@ -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)
 {

Modified: head/sys/compat/linuxkpi/common/include/linux/workqueue.h
==============================================================================
--- head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Nov 30 
09:13:04 2015        (r291480)
+++ head/sys/compat/linuxkpi/common/include/linux/workqueue.h   Mon Nov 30 
09:24:12 2015        (r291481)
@@ -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;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to