Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 10:39:06 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/include/linux: file.h

Log Message:
New fdget/fdput wrappers help to reduce diffs.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/external/bsd/drm2/include/linux/file.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/include/linux/file.h
diff -u src/sys/external/bsd/drm2/include/linux/file.h:1.6 src/sys/external/bsd/drm2/include/linux/file.h:1.7
--- src/sys/external/bsd/drm2/include/linux/file.h:1.6	Sun Dec 19 09:51:04 2021
+++ src/sys/external/bsd/drm2/include/linux/file.h	Sun Dec 19 10:39:06 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: file.h,v 1.6 2021/12/19 09:51:04 riastradh Exp $	*/
+/*	$NetBSD: file.h,v 1.7 2021/12/19 10:39:06 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -39,6 +39,29 @@
 
 struct file;
 
+struct fd {
+	struct file	*file;
+	int		fd_number;
+};
+
+static inline struct fd
+fdget(int number)
+{
+	struct fd fd;
+
+	fd.file = fd_getfile(number);
+	fd.fd_number = number;
+
+	return fd;
+}
+
+static inline void
+fdput(struct fd fd)
+{
+
+	fd_putfile(fd.fd_number);
+}
+
 /* fget translates; fput(fp) doesn't because we have fd_putfile(fd).  */
 static inline struct file *
 fget(int fd)

Reply via email to