summaryrefslogtreecommitdiff
path: root/netfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'netfs.c')
-rw-r--r--netfs.c36
1 files changed, 21 insertions, 15 deletions
diff --git a/netfs.c b/netfs.c
index 1b006a3fc..eb57c3dde 100644
--- a/netfs.c
+++ b/netfs.c
@@ -48,7 +48,7 @@ extern struct fs_backend backend;
This call should unlock DIR no matter what.) */
error_t
netfs_attempt_lookup (struct iouser *user, struct node *dir,
- char *name, struct node **np)
+ const char *name, struct node **np)
{
error_t err = 0;
@@ -79,7 +79,9 @@ netfs_attempt_lookup (struct iouser *user, struct node *dir,
if (*np != dir)
pthread_mutex_lock (&(*np)->lock);
- debug (("Node %s: %i references", name, (*np)->references));
+ debug (("Node %s: %i hard references", name,
+ refcounts_hard_references(&(*np)->refcounts),
+ refcounts_weak_references(&(*np)->refcounts)));
netfs_nref (*np);
}
@@ -140,7 +142,7 @@ netfs_attempt_read (struct iouser *cred, struct node *np,
return. */
error_t
netfs_attempt_write (struct iouser *cred, struct node *np,
- loff_t offset, size_t *len, void *data)
+ loff_t offset, size_t *len, const void *data)
{
if (! backend.write_node)
return EROFS;
@@ -438,7 +440,7 @@ netfs_attempt_syncfs (struct iouser *cred, int wait)
CRED. NP is locked. */
error_t
netfs_set_translator (struct iouser *cred, struct node *np,
- char *argz, size_t argzlen)
+ const char *argz, size_t argzlen)
{
return EOPNOTSUPP;
}
@@ -572,7 +574,7 @@ netfs_attempt_chmod (struct iouser *cred, struct node *np,
(user CRED) into a symlink with target NAME. */
error_t
netfs_attempt_mksymlink (struct iouser *cred, struct node *np,
- char *name)
+ const char *name)
{
error_t err;
@@ -627,7 +629,7 @@ netfs_attempt_chflags (struct iouser *cred, struct node *np,
locked) for USER. */
error_t
netfs_attempt_unlink (struct iouser *user, struct node *dir,
- char *name)
+ const char *name)
{
error_t err;
@@ -642,7 +644,9 @@ netfs_attempt_unlink (struct iouser *user, struct node *dir,
{
pthread_mutex_lock (&node->lock);
- debug (("Node %s: %i references", name, node->references));
+ debug (("Node %s: %i hard references", name,
+ refcounts_hard_references(&node->refcounts),
+ refcounts_weak_references(&node->refcounts)));
err = fshelp_isowner (&node->nn_stat, user);
if (!err)
@@ -662,8 +666,8 @@ netfs_attempt_unlink (struct iouser *user, struct node *dir,
are locked. */
error_t
netfs_attempt_rename (struct iouser *user, struct node *fromdir,
- char *fromname, struct node *todir,
- char *toname, int excl)
+ const char *fromname, struct node *todir,
+ const char *toname, int excl)
{
debug (("FIXME: Not implemented"));
return EOPNOTSUPP;
@@ -674,7 +678,7 @@ netfs_attempt_rename (struct iouser *user, struct node *fromdir,
MODE. */
error_t
netfs_attempt_mkdir (struct iouser *user, struct node *dir,
- char *name, mode_t mode)
+ const char *name, mode_t mode)
{
error_t err = fshelp_isowner (&dir->nn_stat, user);
struct node *newdir;
@@ -691,7 +695,7 @@ netfs_attempt_mkdir (struct iouser *user, struct node *dir,
/* The user must define this function. Attempt to remove directory
named NAME in DIR (which is locked) for USER. */
error_t
-netfs_attempt_rmdir (struct iouser *user, struct node *dir, char *name)
+netfs_attempt_rmdir (struct iouser *user, struct node *dir, const char *name)
{
/* Simply redirect the call */
return netfs_attempt_unlink (user, dir, name);
@@ -704,7 +708,7 @@ netfs_attempt_rmdir (struct iouser *user, struct node *dir, char *name)
NAME is already found in DIR. */
error_t
netfs_attempt_link (struct iouser *user, struct node *dir,
- struct node *file, char *name, int excl)
+ struct node *file, const char *name, int excl)
{
error_t err;
@@ -739,7 +743,7 @@ netfs_attempt_mkfile (struct iouser *user, struct node *dir,
locked on success; no matter what, unlock DIR before returning. */
error_t
netfs_attempt_create_file (struct iouser *user, struct node *dir,
- char *name, mode_t mode, struct node **np)
+ const char *name, mode_t mode, struct node **np)
{
error_t err = fshelp_isowner (&dir->nn_stat, user);
@@ -757,7 +761,9 @@ netfs_attempt_create_file (struct iouser *user, struct node *dir,
/* Lock the new node and add a reference to it on success. */
if (!err && *np)
{
- debug (("Node %s: %i references", name, (*np)->references));
+ debug (("Node %s: %i hard references", name,
+ refcounts_hard_references(&(*np)->refcounts),
+ refcounts_weak_references(&(*np)->refcounts)));
pthread_mutex_lock (&(*np)->lock);
netfs_nref (*np);
}
@@ -786,7 +792,7 @@ netfs_append_args (char **argz, unsigned *argz_len)
returned if some option is unrecognized. The default definition of this
routine will parse them using NETFS_RUNTIME_ARGP. */
error_t
-netfs_set_options (char *argz, size_t argz_len)
+netfs_set_options (const char *argz, size_t argz_len)
{
error_t err = EINVAL;