summaryrefslogtreecommitdiff
path: root/netfs.c
AgeCommit message (Collapse)Author
2013-07-20Add the necessary infrastructure to serve passive translatorsJustus Winter
* netfs.c (netfs_get_translator): New function. * procfs.c (procfs_get_translator): Likewise. * procfs.h (struct procfs_node_ops): New field get_translator. (procfs_get_translator): New function declaration.
2012-12-06Simple implementation of statfsPino Toscano
Initial implementation of statfs reply, just returning the filesystem type and its id. * netfs.c: Include <sys/statvfs.h> and <unistd.h>. (netfs_attempt_statfs): Implement.
2012-11-27Move procfs to pthreadsRichard Braun
2010-09-14Add copyright noticesJeremie Koenig
* dircat.c, dircat.h, main.c, main.h, netfs.c, process.c, process.h, procfs.c, procfs.h, procfs_dir.c, procfs_dir.h, proclist.c, proclist.h, rootdir.c, rootdir.h: Add copyright notices.
2010-08-30Refresh nodes when they're read from the start.Jeremie Koenig
This is necessary for top, for instance, which keeps some files open and re-reads them regularly. As an extra bonus we can drop the refresh hack. * procfs.c, procfs.h: Remove the refresh hack. (procfs_refresh): New function, invalidates the cached contents. * netfs.c (netfs_attempt_read, netfs_get_dirents): Call procfs_refresh when the read is from offset 0. * proclist.c (proclist_make_node): Remove the refresh hack. * dircat.c (dircat_make_node): Likewise. (dircat_get_contents): Use procfs_refresh to avoid keeping old data from the component nodes.
2010-08-30Detect asprintf's ENOMEM in procfs.c rather than everywhereJeremie Koenig
* procfs.h: Make CONTENTS_LEN an ssize_t rather than a size_t, and document the change. * procfs.c (procfs_get_contents): Initialize CONTENTS_LEN to a negative value, and fail with ENOMEM if it's still negative after the callback returns. (everywhere): Update to ssize_t. * dircat.c, netfs.c, process.c, procfs_dir.c, proclist.c, rootdir.c: Update to ssize_t and the new GET_CONTENTS semantics.
2010-08-30Make contents a char* to avoid typecasts all over the placeJeremie Koenig
* procfs.h (procfs_cleanup_contents_with_free, procfs_cleanup_contents_with_vm_deallocate, procfs_get_contents, struct procfs_ops): Change CONTENTS from a void pointer to a char one. * dircat.c, netfs.c, process.c, procfs.c, procfs_dir.c, proclist.c, rootdir.c: Update.
2010-08-30Implement symlinksJeremie Koenig
* netfs.c (netfs_validate_stat): For symlinks, fetch the contents and propagate their length into the nn_stat.st_size field. (netfs_attempt_readlink): Implement using procfs_get_contents.
2010-08-30Handle the ref counter spinlock on cleanupJeremie Koenig
* netfs.c (netfs_node_norefs): Handle the reference counters spinlock so as to avoid deadlocking on reentry.
2010-08-30Implement lookup for . and ..Jeremie Koenig
* procfs.c (procfs_lookup): Keep track of the parent directory, implement the lookup of the dot-directories. (procfs_cleanup): Release the reference to the parent node, if applicable. * procfs.h: Add a comment about the parent reference. * netfs.c (netfs_attempt_lookup): Lock the looked up node after the directory has been unlocked, in case they are the same.
2010-08-30Basic infrastructureJeremie Koenig
* procfs.h: New file; basic interfaces for procfs nodes. * procfs.c: New file; implement the basic infrastructure. * netfs.c: New file; bridge libnetfs and the procfs interfaces. * main.c: New file; mostly a "Hello, World!" for now. * Makefile: New file; standalone for now.