summaryrefslogtreecommitdiff
path: root/libdiskfs/lookup.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-10-24 07:51:40 +0000
committerRoland McGrath <roland@gnu.org>1998-10-24 07:51:40 +0000
commit7493bdb9b7ab8f7f4f97e0a0b7dbf218a862e1bb (patch)
tree6f3d9bd428069827da31cd8d03851321fea433c4 /libdiskfs/lookup.c
parent6875a586d28418b4ed203dc00cc8db3061f9a003 (diff)
1998-09-04 Roland McGrath <roland@baalperazim.frob.com>
* 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.
Diffstat (limited to 'libdiskfs/lookup.c')
-rw-r--r--libdiskfs/lookup.c17
1 files changed, 8 insertions, 9 deletions
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;
}
-