| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: psshfs.c,v 1.60 2010/02/17 15:50:54 pooka Exp $ */ | | 1 | /* $NetBSD: psshfs.c,v 1.61 2010/02/17 15:54:10 pooka Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. | | 4 | * Copyright (c) 2006-2009 Antti Kantee. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Redistribution and use in source and binary forms, with or without | | 6 | * Redistribution and use in source and binary forms, with or without |
7 | * modification, are permitted provided that the following conditions | | 7 | * modification, are permitted provided that the following conditions |
8 | * are met: | | 8 | * are met: |
9 | * 1. Redistributions of source code must retain the above copyright | | 9 | * 1. Redistributions of source code must retain the above copyright |
10 | * notice, this list of conditions and the following disclaimer. | | 10 | * notice, this list of conditions and the following disclaimer. |
11 | * 2. Redistributions in binary form must reproduce the above copyright | | 11 | * 2. Redistributions in binary form must reproduce the above copyright |
12 | * notice, this list of conditions and the following disclaimer in the | | 12 | * notice, this list of conditions and the following disclaimer in the |
13 | * documentation and/or other materials provided with the distribution. | | 13 | * documentation and/or other materials provided with the distribution. |
14 | * | | 14 | * |
| @@ -31,27 +31,27 @@ | | | @@ -31,27 +31,27 @@ |
31 | * psshfs implements sshfs functionality on top of puffs making it | | 31 | * psshfs implements sshfs functionality on top of puffs making it |
32 | * possible to mount a filesystme through the sftp service. | | 32 | * possible to mount a filesystme through the sftp service. |
33 | * | | 33 | * |
34 | * psshfs can execute multiple operations in "parallel" by using the | | 34 | * psshfs can execute multiple operations in "parallel" by using the |
35 | * puffs_cc framework for continuations. | | 35 | * puffs_cc framework for continuations. |
36 | * | | 36 | * |
37 | * Concurrency control is handled currently by vnode locking (this | | 37 | * Concurrency control is handled currently by vnode locking (this |
38 | * will change in the future). Context switch locations are easy to | | 38 | * will change in the future). Context switch locations are easy to |
39 | * find by grepping for puffs_framebuf_enqueue_cc(). | | 39 | * find by grepping for puffs_framebuf_enqueue_cc(). |
40 | */ | | 40 | */ |
41 | | | 41 | |
42 | #include <sys/cdefs.h> | | 42 | #include <sys/cdefs.h> |
43 | #ifndef lint | | 43 | #ifndef lint |
44 | __RCSID("$NetBSD: psshfs.c,v 1.60 2010/02/17 15:50:54 pooka Exp $"); | | 44 | __RCSID("$NetBSD: psshfs.c,v 1.61 2010/02/17 15:54:10 pooka Exp $"); |
45 | #endif /* !lint */ | | 45 | #endif /* !lint */ |
46 | | | 46 | |
47 | #include <sys/types.h> | | 47 | #include <sys/types.h> |
48 | #include <sys/wait.h> | | 48 | #include <sys/wait.h> |
49 | | | 49 | |
50 | #include <assert.h> | | 50 | #include <assert.h> |
51 | #include <err.h> | | 51 | #include <err.h> |
52 | #include <errno.h> | | 52 | #include <errno.h> |
53 | #include <mntopts.h> | | 53 | #include <mntopts.h> |
54 | #include <paths.h> | | 54 | #include <paths.h> |
55 | #include <poll.h> | | 55 | #include <poll.h> |
56 | #include <puffs.h> | | 56 | #include <puffs.h> |
57 | #include <signal.h> | | 57 | #include <signal.h> |
| @@ -280,27 +280,27 @@ main(int argc, char *argv[]) | | | @@ -280,27 +280,27 @@ main(int argc, char *argv[]) |
280 | } else { | | 280 | } else { |
281 | pctx.sshfd_data = pctx.sshfd; | | 281 | pctx.sshfd_data = pctx.sshfd; |
282 | } | | 282 | } |
283 | | | 283 | |
284 | if (exportfs) | | 284 | if (exportfs) |
285 | puffs_setfhsize(pu, sizeof(struct psshfs_fid), | | 285 | puffs_setfhsize(pu, sizeof(struct psshfs_fid), |
286 | PUFFS_FHFLAG_NFSV2 | PUFFS_FHFLAG_NFSV3); | | 286 | PUFFS_FHFLAG_NFSV2 | PUFFS_FHFLAG_NFSV3); |
287 | | | 287 | |
288 | rva = &pn_root->pn_va; | | 288 | rva = &pn_root->pn_va; |
289 | rva->va_fileid = pctx.nextino++; | | 289 | rva->va_fileid = pctx.nextino++; |
290 | | | 290 | |
291 | /* | | 291 | /* |
292 | * For root link count, just guess something ridiculously high. | | 292 | * For root link count, just guess something ridiculously high. |
293 | * Guessing too high has no known adverse effects, but fsu() | | 293 | * Guessing too high has no known adverse effects, but fts(3) |
294 | * doesn't like too low values. This guess will be replaced | | 294 | * doesn't like too low values. This guess will be replaced |
295 | * with the real value when readdir is first called for | | 295 | * with the real value when readdir is first called for |
296 | * the root directory. | | 296 | * the root directory. |
297 | */ | | 297 | */ |
298 | rva->va_nlink = 8811; | | 298 | rva->va_nlink = 8811; |
299 | | | 299 | |
300 | if (detach) | | 300 | if (detach) |
301 | if (puffs_daemon(pu, 1, 1) == -1) | | 301 | if (puffs_daemon(pu, 1, 1) == -1) |
302 | err(1, "puffs_daemon"); | | 302 | err(1, "puffs_daemon"); |
303 | | | 303 | |
304 | if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1) | | 304 | if (puffs_mount(pu, argv[1], mntflags, puffs_getroot(pu)) == -1) |
305 | err(1, "puffs_mount"); | | 305 | err(1, "puffs_mount"); |
306 | if (puffs_setblockingmode(pu, PUFFSDEV_NONBLOCK) == -1) | | 306 | if (puffs_setblockingmode(pu, PUFFSDEV_NONBLOCK) == -1) |