Commit Graph

419 Commits

Author SHA1 Message Date
christos 79e2355ab8 Adjust to prototype. 2017-05-31 17:56:00 +00:00
christos 518a4ef5c5 Only add a write filter for sockets. It is not supported for vnodes, or
for 1/2 closed fifos (which we both have now).
2017-05-09 21:15:30 +00:00
tnn 523a6b00a9 mention puffs_node_pathconf and puffs_node_advlock 2016-08-29 01:13:56 +00:00
christos 6b3f51ca99 there is no pflags, just flags. 2016-04-11 00:47:19 +00:00
christos ffeb8dbf4e Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
christos 05dbf82446 consistency fixes. 2015-11-12 17:51:05 +00:00
christos ab2f8d0338 fix return type 2015-11-09 15:12:12 +00:00
christos 5521b51a7a fix error messages 2015-06-17 00:15:26 +00:00
wiz bcb2129dc2 filesystem -> file system 2015-02-16 10:48:56 +00:00
wiz 8ca9874e72 Sort sections. 2015-02-16 10:48:50 +00:00
wiz 0c9e1ca798 Bump date for previous.
filesystem -> file system
2015-02-16 10:48:34 +00:00
manu 8abab6b782 Add PUFFS_KFLAG_NOFLUSH_META to prevent sending metadata flush to FUSE
FUSE filesystems do not expect to get metadata updates for [amc]time
and size, they updates the value on their own after operations.

The PUFFS PUFFS_KFLAG_NOFLUSH_META option prevents regular metadata cache
flushes to the filesystem , and libperfuse uses it to match Linux FUSE
behavior.

While there, fix a bug in SETATTR: do not update kernel metadata cache
from SETATTR reply when the request is asynchronous, as we do not have
the reply yet.
2015-02-15 20:21:29 +00:00
manu 8ee430e576 Do not warn about relative path because of trailing slash
libpuffs calls realpath() to obtain an absolute path to use for mounting.
If the obtained path is different from the one given by the caller, a
warning is issued. This included the situation where the path passed by
the caller just have trailing slashes, a situation where we just want them
to be striped without a warning.
2014-12-22 08:16:21 +00:00
wiz a2ba5a05a6 Bump date for previous. Remove trailing space. 2014-10-31 14:01:16 +00:00
manu cf73d5332b libpuffs support for fallocate and fdiscard operations 2014-10-31 13:56:04 +00:00
snj f0a7346d21 src is too big these days to tolerate superfluous apostrophes. It's
"its", people!
2014-10-18 08:33:23 +00:00
wiz 70e44a6c96 Bump date for previous. 2014-08-16 21:50:15 +00:00
manu ccfb03f9b0 Add an open2 method, like open but with an additionnal oflags used
by the filesystem to send back information about the file.
This is used to implement PUFFS_OPEN_IO_DIRECT by which the filesystem
tells the kernel that read/write should bypass the page cache.
2014-08-16 16:25:44 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
christos 27c90c0e19 revert previous, will turn off globally. 2013-11-06 19:56:38 +00:00
christos 48ec4b4e3a XXX: gcc initialization (mc68k gcc-4.5.x gcc-4.8.x) 2013-11-06 19:50:10 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
riastradh 8b3a72d661 Assert equality, not assignment, in puffs__fsframe_cmp. 2013-01-23 20:22:34 +00:00
wiz 9cdff3cdd6 Bump date for previous. 2012-08-16 11:28:48 +00:00
wiz 0e61416223 Whitespace fixes. Bump date for previous. 2012-08-16 11:28:38 +00:00
manu d256e38414 Fix regression that has been introduced when the lookup/reclaim race
condition was addressed in libpuffs by counting lookups.

The fix assumes that cookies map to struct puffs_cookie, which has not
been documented as a requirement for filesystems using libpuffs. As an
example, we got burnt by this assumption in libp2k (kern/46734), and
we fixed bit by actually mapping libp2k cookies to struct puffs_node.

It is unlikely, but there may be third party filesystems that use cookies
unmapped to struct puffs_node, and they were left broken for now.

- we introduce a puffs_init() flag PUFFS_FLAG_PNCOOKIE that let filesystems
inform libpuffs that they map cookies to struct puffs_node. Is that flag
is used, the lookup/reclaim race condition fix is enabled. We enable the
flag for libp2k.

- filesystems that use puffs_pn_new() obviouslty use struct puffs_node
and gain PUFFS_FLAG_PNCOOKIE automatically even if they did not specify
it in puffs_init(). This include all our PUFFS filesystem in-tree except
libp2k.

- for filesystems not willing to use struct puffs_node, we introduce a
reclaim2 vnop, which is reclaim with an additionnal lookup count argument.
This vnop let the filesystem implement the lookup/reclaim race fix on
its own.
2012-08-16 09:25:43 +00:00
wiz aceedc0215 Use more markup. New sentence, new line. Bump date for previous. 2012-08-10 21:00:45 +00:00
manu 2a9a80bb36 Add PUFFS_KFLAG_CACHE_DOTDOT so that vnodes hold a reference on their
parent, keeping them active, and allowing to lookup .. without sending
a request to the filesystem.

Enable the featuure for perfused, as this is how FUSE works.
2012-08-10 16:49:35 +00:00
manu 244cd4a742 Fix race condition between (create|mknod|mkdir|symlino) and reclaim, just
like we did it between lookup and reclaim.
2012-08-10 08:42:10 +00:00
njoly 6ddf50a26a Kill extra Fc macro. 2012-07-28 09:56:09 +00:00
manu 8502ba8ea3 - Improve PUFFS_KFLAG_CACHE_FS_TTL by reclaiming older inactive nodes.
The normal kernel behavior is to retain inactive nodes in the freelist
until it runs out of vnodes. This has some merit for local filesystems,
where the cost of an allocation is about the same as the cost of a
lookup. But that situation is not true for distributed filesystems.
On the other hand, keeping inactive nodes for a long time hold memory
in the file server process, and when the kernel runs out of vnodes, it
produce reclaim avalanches that increase lattency for other operations.

We do not reclaim inactive vnodes immediatly either, as they may be
looked up again shortly. Instead we introduce a grace time and we
reclaim nodes that have been inactive beyond the grace time.

- Fix lookup/reclaim race condition.

The above improvement undercovered a race condition between lookup and
reclaim. If we reclaimed a vnode associated with a userland cookie while
a lookup returning that same cookiewas inprogress, then the kernel ends
up with a vnode associated with a cookie that has been reclaimed in
userland. Next operation on the cookie will crash (or at least confuse)
the filesystem.

We fix this by introducing a lookup count in kernel and userland. On
reclaim, the kernel sends the count, which enable userland to detect
situation where it initiated a lookup that is not completed in kernel.
In such a situation, the reclaim must be ignored, as the node is about
to be looked up again.
2012-07-21 05:17:10 +00:00
wiz db0ea5f9de Bump date for previous, remove trailing whitespace. 2012-06-27 20:30:52 +00:00
manu d1056538cc Pass the FAF flag to handlers:
- setattr_ttl is updated to add a flag argument. Since it was not present in
  a previous release, we can change its API
- write2 is introduced, this is write with an extra flag for FAF.
- fsync already has the FAF information in a flag and needs no change
- for other operations, FAF is unconditional
2012-06-27 13:25:23 +00:00
abs 9e66e6d75e Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
2012-06-25 22:32:43 +00:00
wiz d2ca09c94d Bump date for previous.
New sentence, new line; remove trailing whitespace; fix typos;
punctuation nits.
2012-04-18 14:24:26 +00:00
manu 70d8192475 - When using PUFFS_KFLAG_CACHE_FS_TTL, do not use puffs_node to carry
attribute and TTL fora newly created node. Instead extend puffs_newinfo
  and add puffs_newinfo_setva() and puffs_newinfo_setttl()
- Remove node_mk_common_final in libperfuse. It used to set uid/gid for
  a newly created vnode but has been made redundant along time ago since
  uid and gid are properly set in FUSE header.
- In libperfuse, check for corner case where opc = 0 on INACTIVE and   RECLAIM (how is it possible? Check for it to avoid a crash anyway)
- In libperfuse, make sure we unlimit RLIMIT_AS and RLIMIT_DATA so that
  we do notrun out of memory because the kernel is lazy at reclaiming vnodes.
- In libperfuse, cleanup style of perfuse_destroy_pn()
2012-04-18 00:57:21 +00:00
wiz 72e34f2f4a Split file system.
Comma fixes.
Remove dangling "and".
Bump date for previous.
2012-04-08 16:09:55 +00:00
manu fb4eb35384 Add PUFFS_KFLAG_CACHE_FS_TTL flag to puffs_init(3) to use name and
attribute cache with filesystem provided TTL.
lookup, create, mknod, mkdir, symlink, getattr and setattr messages
have been extended so that attributes and their TTL can be provided
by the filesytem. lookup, create, mknod, mkdir, and symlink messages
are also extended so that the filesystem can provide name TTL.
The filesystem updates attributes and TTL using
puffs_pn_getvap(3), puffs_pn_getvattl(3), and puffs_pn_getcnttl(3)
2012-04-08 15:07:45 +00:00
matt fa835e8c8b These directories default to WARNS?=5 2012-03-21 05:37:42 +00:00
njoly 874d053d0b Use puffs_access() return value in the VA_UTIMES_NULL case. 2012-03-15 12:49:36 +00:00
joerg 66dd2755f5 Add __printflike attribution to use vprintf and friends with an argument
as format string.
2012-03-15 02:02:20 +00:00
njoly f5d424631e Remove obsolete puffs_suspend(3) xref. 2011-12-26 17:59:07 +00:00
riastradh dade315727 Fix error reporting in puffs_framev_enqueue_waitevent and callers.
ok christos
2011-12-19 15:36:26 +00:00
skrll 79fb68b068 Deal with __MACHINE_STACK_GROWS_UP machines.
constify the other psize while I'm here.

Thanks to Christos for looking.
2011-12-06 21:15:39 +00:00
manu 154cec5236 Rollback previous change as it breaks autmates tests 2011-11-25 15:02:02 +00:00
manu bd5d68a6d1 Documentation fix
Evgeniy Ivanov <lolkaantimat@gmail.com>
2011-11-24 01:59:25 +00:00
manu 77ac17e5c3 Remove files specified in pcn.
When remove files using name from pnode, another link on this file
can be unlinked. E.g. "touch 1; ln 1 2; rm 2" will remove file named
"1". Thus puffs_null_node_remove should remove directory entry which
name is provided by pcn (as said in puffs_ops.3). Caller should
provide appropriately initialized pcn.

From Evgeniy Ivanov <lolkaantimat@gmail.com>
2011-11-24 01:58:52 +00:00
manu c068d4996c Remove pnode of overwritten file.
When puffs_null_node_rename() overwrites existing file, its pnode
must be removed, because src pnode already represents this file.

From Evgeniy Ivanov <lolkaantimat@gmail.com>
2011-11-24 01:55:33 +00:00
chs 81742ac3ab fix crashes caused by using the results of getcontext()
after the caller returns.
2011-11-14 01:27:42 +00:00
yamt 9647763d4a puffs_cc_yield: fix a cc leak. PR/44679 2011-11-02 16:43:04 +00:00