From 7493bdb9b7ab8f7f4f97e0a0b7dbf218a862e1bb Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sat, 24 Oct 1998 07:51:40 +0000 Subject: 1998-09-04 Roland McGrath * diskfs.h (diskfs_lookup_hard, diskfs_lookup, diskfs_set_translator, diskfs_create_symlink_hook, diskfs_notice_dirchange, diskfs_direnter, diskfs_direnter_hard, diskfs_dirrewrite, diskfs_dirremove, diskfs_create_node, diskfs_enter_lookup_cache, diskfs_check_lookup_cache, dir_rename_dir, diskfs_set_options): Add `const' qualifier to `char *' parameters where appropriate. * opts-set.c (diskfs_set_options): Fix defn with `const'. * node-create.c (diskfs_create_node): Likewise. * name-cache.c (diskfs_enter_lookup_cache): Likewise. (diskfs_check_lookup_cache): Likewise. * dirremove.c (diskfs_dirremove): Likewise. * dirrewrite.c (diskfs_dirrewrite): Likewise. * lookup.c (diskfs_lookup): Likewise. * direnter.c (diskfs_direnter): Likewise. * dir-renamed.c (diskfs_rename_dir): Likewise. * dir-chg.c (diskfs_notice_dirchange): Likewise. --- libdiskfs/lookup.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'libdiskfs/lookup.c') diff --git a/libdiskfs/lookup.c b/libdiskfs/lookup.c index bc61f4ba..cd5ca8cb 100644 --- a/libdiskfs/lookup.c +++ b/libdiskfs/lookup.c @@ -73,11 +73,11 @@ static spin_lock_t cm_lock = SPIN_LOCK_INITIALIZER; Return ENOENT if NAME isn't in the directory. Return EAGAIN if NAME refers to the `..' of this filesystem's root. Return EIO if appropriate. - - This function is a wrapper for diskfs_lookup_hard. + + This function is a wrapper for diskfs_lookup_hard. */ -error_t -diskfs_lookup (struct node *dp, char *name, enum lookup_type type, +error_t +diskfs_lookup (struct node *dp, const char *name, enum lookup_type type, struct node **np, struct dirstat *ds, struct protid *cred) { error_t err; @@ -146,7 +146,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type, diskfs_null_dirstat (ds); } else - { + { err = diskfs_lookup_hard (dp, name, type, np, ds, cred); spin_lock (&cm_lock); @@ -156,7 +156,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type, cache_misses.absent++; else if (err) cache_misses.errors++; - else + else cache_misses.present++; if (name[0] == '.') { @@ -170,7 +170,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type, if (err && err != ENOENT) return err; - + if (type == RENAME || (type == CREATE && err == ENOENT) || (type == REMOVE && err != ENOENT)) @@ -190,8 +190,7 @@ diskfs_lookup (struct node *dp, char *name, enum lookup_type type, diskfs_enter_lookup_cache (dp, *np, name); else if (type == LOOKUP && err == ENOENT) diskfs_enter_lookup_cache (dp, 0, name); - } + } return err; } - -- cgit v1.2.3