Module Name:    src
Committed By:   pooka
Date:           Wed Jul 21 06:58:26 UTC 2010

Modified Files:
        src/tests/fs/puffs/h_dtfs: dtfs.c dtfs_vnops.c

Log Message:
support pathconf (more or less copypasted from ufs).  for njoly's tests.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/fs/puffs/h_dtfs/dtfs.c
cvs rdiff -u -r1.6 -r1.7 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c

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

Modified files:

Index: src/tests/fs/puffs/h_dtfs/dtfs.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs.c:1.1 src/tests/fs/puffs/h_dtfs/dtfs.c:1.2
--- src/tests/fs/puffs/h_dtfs/dtfs.c:1.1	Tue Jul  6 14:16:44 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs.c	Wed Jul 21 06:58:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtfs.c,v 1.1 2010/07/06 14:16:44 pooka Exp $	*/
+/*	$NetBSD: dtfs.c,v 1.2 2010/07/21 06:58:25 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006  Antti Kantee.  All Rights Reserved.
@@ -206,6 +206,7 @@
 	PUFFSOP_SET(pops, dtfs, node, readlink);
 	PUFFSOP_SET(pops, dtfs, node, mknod);
 	PUFFSOP_SET(pops, dtfs, node, inactive);
+	PUFFSOP_SET(pops, dtfs, node, pathconf);
 	PUFFSOP_SET(pops, dtfs, node, reclaim);
 
 	srandom(time(NULL)); /* for random generation numbers */

Index: src/tests/fs/puffs/h_dtfs/dtfs_vnops.c
diff -u src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.6 src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.7
--- src/tests/fs/puffs/h_dtfs/dtfs_vnops.c:1.6	Wed Jul 14 21:24:40 2010
+++ src/tests/fs/puffs/h_dtfs/dtfs_vnops.c	Wed Jul 21 06:58:25 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: dtfs_vnops.c,v 1.6 2010/07/14 21:24:40 pooka Exp $	*/
+/*	$NetBSD: dtfs_vnops.c,v 1.7 2010/07/21 06:58:25 pooka Exp $	*/
 
 /*
  * Copyright (c) 2006  Antti Kantee.  All Rights Reserved.
@@ -515,6 +515,47 @@
 }
 
 int
+dtfs_node_pathconf(struct puffs_usermount *pu, puffs_cookie_t opc,
+	int name, register_t *retval)
+{
+
+	switch (name) {
+	case _PC_LINK_MAX:
+		*retval = LINK_MAX;
+		return 0;
+	case _PC_NAME_MAX:
+		*retval = NAME_MAX;
+		return 0;
+	case _PC_PATH_MAX:
+		*retval = PATH_MAX;
+		return 0;
+	case _PC_PIPE_BUF:
+		*retval = PIPE_BUF;
+		return 0;
+	case _PC_CHOWN_RESTRICTED:
+		*retval = 1;
+		return 0;
+	case _PC_NO_TRUNC:
+		*retval = 1;
+		return 0;
+	case _PC_SYNC_IO:
+		*retval = 1;
+		return 0;
+	case _PC_FILESIZEBITS:
+		*retval = 43; /* this one goes to 11 */
+		return 0;
+	case _PC_SYMLINK_MAX:
+		*retval = MAXPATHLEN;
+		return 0;
+	case _PC_2_SYMLINKS:
+		*retval = 1;
+		return 0;
+	default:
+		return EINVAL;
+	}
+}
+
+int
 dtfs_node_inactive(struct puffs_usermount *pu, puffs_cookie_t opc)
 {
 	struct puffs_node *pn = opc;

Reply via email to