mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rdunlap@xenotime.net>
To: lkml <linux-kernel@vger.kernel.org>
Cc: akpm <akpm@osdl.org>, linuxram@us.ibm.com
Subject: [PATCH 8/14/] Doc. sources: expose smount
Date: Sun, 21 May 2006 20:57:46 -0700	[thread overview]
Message-ID: <20060521205746.978f42ed.rdunlap@xenotime.net> (raw)
In-Reply-To: <20060521203349.40b40930.rdunlap@xenotime.net>

From: Randy Dunlap <rdunlap@xenotime.net>

Documentation/sharedsubtree.txt:
Expose example and tool source files in the Documentation/ directory in
their own files instead of being buried (almost hidden) in readme/txt files.

This will make them more visible/usable to users who may need
to use them, to developers who may need to test with them, and
to janitors who would update them if they were more visible.

Also, if any of these possibly should not be in the kernel tree at
all, it will be clearer that they are here and we can discuss if
they should be removed.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
---
 Documentation/sharedsubtree.txt |   81 +---------------------------------------
 Documentation/smount.c          |   72 +++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+), 78 deletions(-)

--- linux-2617-rc4g9-docsrc-split.orig/Documentation/sharedsubtree.txt
+++ linux-2617-rc4g9-docsrc-split/Documentation/sharedsubtree.txt
@@ -140,85 +140,10 @@ replicas continue to be exactly same.
 3) smount command
 
 	Currently the mount command is not aware of shared subtree features.
-	Work is in progress to add the support in mount ( util-linux package ).
-	Till then use the following program.
+	Work is in progress to add the support in mount (util-linux package).
+	Until then use the following program: see Documentation/smount.c
 
-	------------------------------------------------------------------------
-	//
-	//this code was developed my Miklos Szeredi <miklos@szeredi.hu>
-	//and modified by Ram Pai <linuxram@us.ibm.com>
-	// sample usage:
-	//              smount /tmp shared
-	//
-	#include <stdio.h>
-	#include <stdlib.h>
-	#include <unistd.h>
-	#include <sys/mount.h>
-	#include <sys/fsuid.h>
-
-	#ifndef MS_REC
-	#define MS_REC		0x4000	/* 16384: Recursive loopback */
-	#endif
-
-	#ifndef MS_SHARED
-	#define MS_SHARED		1<<20	/* Shared */
-	#endif
-
-	#ifndef MS_PRIVATE
-	#define MS_PRIVATE		1<<18	/* Private */
-	#endif
-
-	#ifndef MS_SLAVE
-	#define MS_SLAVE		1<<19	/* Slave */
-	#endif
-
-	#ifndef MS_UNBINDABLE
-	#define MS_UNBINDABLE		1<<17	/* Unbindable */
-	#endif
-
-	int main(int argc, char *argv[])
-	{
-		int type;
-		if(argc != 3) {
-			fprintf(stderr, "usage: %s dir "
-			"<rshared|rslave|rprivate|runbindable|shared|slave"
-			"|private|unbindable>\n" , argv[0]);
-			return 1;
-		}
-
-		fprintf(stdout, "%s %s %s\n", argv[0], argv[1], argv[2]);
-
-		if (strcmp(argv[2],"rshared")==0)
-			type=(MS_SHARED|MS_REC);
-		else if (strcmp(argv[2],"rslave")==0)
-			type=(MS_SLAVE|MS_REC);
-		else if (strcmp(argv[2],"rprivate")==0)
-			type=(MS_PRIVATE|MS_REC);
-		else if (strcmp(argv[2],"runbindable")==0)
-			type=(MS_UNBINDABLE|MS_REC);
-		else if (strcmp(argv[2],"shared")==0)
-			type=MS_SHARED;
-		else if (strcmp(argv[2],"slave")==0)
-			type=MS_SLAVE;
-		else if (strcmp(argv[2],"private")==0)
-			type=MS_PRIVATE;
-		else if (strcmp(argv[2],"unbindable")==0)
-			type=MS_UNBINDABLE;
-		else {
-			fprintf(stderr, "invalid operation: %s\n", argv[2]);
-			return 1;
-		}
-		setfsuid(getuid());
-
-		if(mount("", argv[1], "dontcare", type, "") == -1) {
-			perror("mount");
-			return 1;
-		}
-		return 0;
-	}
-	-----------------------------------------------------------------------
-
-	Copy the above code snippet into smount.c
+	Build/make:
 	gcc -o smount smount.c
 
 
--- /dev/null
+++ linux-2617-rc4g9-docsrc-split/Documentation/smount.c
@@ -0,0 +1,72 @@
+//
+// this code was developed my Miklos Szeredi <miklos@szeredi.hu>
+// and modified by Ram Pai <linuxram@us.ibm.com>
+// sample usage:
+//              smount /tmp shared
+//
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/mount.h>
+#include <sys/fsuid.h>
+
+#ifndef MS_REC
+#define MS_REC		0x4000	/* 16384: Recursive loopback */
+#endif
+
+#ifndef MS_SHARED
+#define MS_SHARED		1<<20	/* Shared */
+#endif
+
+#ifndef MS_PRIVATE
+#define MS_PRIVATE		1<<18	/* Private */
+#endif
+
+#ifndef MS_SLAVE
+#define MS_SLAVE		1<<19	/* Slave */
+#endif
+
+#ifndef MS_UNBINDABLE
+#define MS_UNBINDABLE		1<<17	/* Unbindable */
+#endif
+
+int main(int argc, char *argv[])
+{
+	int type;
+	if (argc != 3) {
+		fprintf(stderr, "usage: %s dir "
+		"<rshared|rslave|rprivate|runbindable|shared|slave"
+		"|private|unbindable>\n" , argv[0]);
+		return 1;
+	}
+
+	fprintf(stdout, "%s %s %s\n", argv[0], argv[1], argv[2]);
+
+	if (strcmp(argv[2],"rshared")==0)
+		type=(MS_SHARED|MS_REC);
+	else if (strcmp(argv[2],"rslave")==0)
+		type=(MS_SLAVE|MS_REC);
+	else if (strcmp(argv[2],"rprivate")==0)
+		type=(MS_PRIVATE|MS_REC);
+	else if (strcmp(argv[2],"runbindable")==0)
+		type=(MS_UNBINDABLE|MS_REC);
+	else if (strcmp(argv[2],"shared")==0)
+		type=MS_SHARED;
+	else if (strcmp(argv[2],"slave")==0)
+		type=MS_SLAVE;
+	else if (strcmp(argv[2],"private")==0)
+		type=MS_PRIVATE;
+	else if (strcmp(argv[2],"unbindable")==0)
+		type=MS_UNBINDABLE;
+	else {
+		fprintf(stderr, "invalid operation: %s\n", argv[2]);
+		return 1;
+	}
+	setfsuid(getuid());
+
+	if (mount("", argv[1], "dontcare", type, "") == -1) {
+		perror("mount");
+		return 1;
+	}
+	return 0;
+}


---

  parent reply	other threads:[~2006-05-22  3:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060521203349.40b40930.rdunlap@xenotime.net>
2006-05-22  3:57 ` [PATCH 2/14/] Doc. sources: expose vm/ Randy.Dunlap
2006-05-22  3:57 ` [PATCH 3/14/] Doc. sources: expose video4linux/ Randy.Dunlap
2006-05-22  3:57 ` [PATCH 4/14/] Doc. sources: expose block/ Randy.Dunlap
2006-05-22  3:57 ` [PATCH 5/14/] Doc. sources: expose s390/ Randy.Dunlap
2006-05-22  3:57 ` [PATCH 6/14/] Doc. sources: expose pcmcia/ Randy.Dunlap
2006-05-29 15:17   ` Dominik Brodowski
2006-05-22  3:57 ` [PATCH 7/14/] Doc. sources: expose rtc Randy.Dunlap
2006-05-22  3:57 ` Randy.Dunlap [this message]
2006-05-22  3:57 ` [PATCH 9/14/] Doc. sources: expose dnotify Randy.Dunlap
2006-05-22  3:57 ` [PATCH 10/14/] Doc. sources: expose laptop-mode Randy.Dunlap
2006-05-22  5:23   ` Bart Samwel
2006-05-22 15:35     ` Randy.Dunlap
2006-05-23  8:37       ` Bart Samwel
2006-05-22  3:57 ` [PATCH 11/14/] Doc. sources: expose hpet Randy.Dunlap
2006-05-22  3:57 ` [PATCH 12/14/] Doc. sources: expose java Randy.Dunlap
2006-05-22  3:57 ` [PATCH 13/14/] Doc. sources: expose mtrr Randy.Dunlap
2006-05-22  3:57 ` [PATCH 14/14/] Doc. sources: expose kprobes Randy.Dunlap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060521205746.978f42ed.rdunlap@xenotime.net \
    --to=rdunlap@xenotime.net \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxram@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®