aboutsummaryrefslogtreecommitdiff
path: root/libdiskfs/file-set-trans.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdiskfs/file-set-trans.c')
-rw-r--r--libdiskfs/file-set-trans.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/libdiskfs/file-set-trans.c b/libdiskfs/file-set-trans.c
index 1143ef4a..26a19eb4 100644
--- a/libdiskfs/file-set-trans.c
+++ b/libdiskfs/file-set-trans.c
@@ -1,5 +1,5 @@
/* libdiskfs implementation of fs.defs: file_set_translator
- Copyright (C) 1992, 1993, 1994, 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1992,93,94,95,96,99,2001,02 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@ -20,9 +20,6 @@
#include <hurd/paths.h>
#include <hurd/fsys.h>
-/* XXX - Temporary */
-#define makedev(maj,min) ((((maj)&0xFF)<<8)+((min)&0xFF))
-
/* Implement file_set_translator as described in <hurd/fs.defs>. */
kern_return_t
diskfs_S_file_set_translator (struct protid *cred,
@@ -30,7 +27,7 @@ diskfs_S_file_set_translator (struct protid *cred,
int active_flags,
int killtrans_flags,
char *passive,
- u_int passivelen,
+ size_t passivelen,
fsys_t active)
{
struct node *np;
@@ -53,14 +50,15 @@ diskfs_S_file_set_translator (struct protid *cred,
mutex_lock (&np->lock);
- error = diskfs_isowner (np, cred);
+ error = fshelp_isowner (&np->dn_stat, cred->user);
if (error)
{
mutex_unlock (&np->lock);
return error;
}
- if (active_flags & FS_TRANS_SET)
+ if ((active_flags & FS_TRANS_SET)
+ && ! (active_flags & FS_TRANS_ORPHAN))
{
error = fshelp_fetch_control (&np->transbox, &control);
if (error)
@@ -87,7 +85,7 @@ diskfs_S_file_set_translator (struct protid *cred,
/* Handle exclusive passive bit *first*. */
if ((passive_flags & FS_TRANS_SET)
&& (passive_flags & FS_TRANS_EXCL)
- && np->istranslated)
+ && (np->dn_stat.st_mode & S_IPTRANS))
{
mutex_unlock (&np->lock);
return EBUSY;
@@ -159,7 +157,7 @@ diskfs_S_file_set_translator (struct protid *cred,
}
minor = strtol (arg, 0, 0);
- error = diskfs_validate_rdev_change (np,
+ error = diskfs_validate_rdev_change (np,
makedev (major, minor));
if (error)
{