[Devel] [RFC][PATCH 1/2] pipe: header file and removal of dupfd()'s static

Masahiko Takahashi masahiko at linux-foundation.org
Mon Jan 29 14:48:16 PST 2007


[RFC][PATCH 1/2] pipe: header file and removal of dupfd()'s static

Defines data structures in order to use checkpointing a pipe.
Also, dupfd() in fcntl.c is called in restoring pipe so as to
install struct file pointer to the specified file descriptor.

Masahiko.

-------------- next part --------------
--- /dev/null	2006-05-22 07:25:23.000000000 -0700
+++ linux-2.6.19.2/include/linux/cr.h	2007-01-22 15:19:28.000000000 -0800
@@ -0,0 +1,27 @@
+#ifndef	_LINUX_CR_H
+#define	_LINUX_CR_H
+
+/*
+ *	include/linux/cr.h
+ *	
+ *	checkpoint and restart
+ */
+
+struct cr_pipe_buffer_info {
+	unsigned int offset, len, flags;
+};
+
+struct cr_pipe_buffer {
+	char buf[PAGE_SIZE];
+	struct cr_pipe_buffer_info info;
+};
+		
+struct cr_pipe {
+	int nrbufs;
+	// waiter, fasync ...
+	struct cr_pipe_buffer bufs[PIPE_BUFFERS];
+};
+
+extern int dupfd(struct file *file, unsigned int start);
+
+#endif
--- linux-2.6.19.2/fs/fcntl.c.original	2007-01-10 11:10:37.000000000 -0800
+++ linux-2.6.19.2/fs/fcntl.c	2007-01-15 16:36:56.000000000 -0800
@@ -111,7 +111,7 @@ out:
 	return error;
 }
 
-static int dupfd(struct file *file, unsigned int start)
+int dupfd(struct file *file, unsigned int start)
 {
 	struct files_struct * files = current->files;
 	struct fdtable *fdt;
-------------- next part --------------
_______________________________________________
Containers mailing list
Containers at lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers


More information about the Devel mailing list