From owner-svn-src-all@freebsd.org Mon Nov 30 09:24:14 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11B1CA3C963; Mon, 30 Nov 2015 09:24:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B9E231B45; Mon, 30 Nov 2015 09:24:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id tAU9OCoi049790; Mon, 30 Nov 2015 09:24:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tAU9OC7o049788; Mon, 30 Nov 2015 09:24:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201511300924.tAU9OC7o049788@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 30 Nov 2015 09:24:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r291481 - head/sys/compat/linuxkpi/common/include/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Nov 2015 09:24:14 -0000 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;