diff options
author | Michael I. Bushnell <mib@gnu.org> | 1996-07-04 21:32:05 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1996-07-04 21:32:05 +0000 |
commit | c514c1ec76e9a53c7e66a6ef06a0d5b665060045 (patch) | |
tree | 884c7fba0c22e9d010fd2b049bd4b8f35835bbbd /libnetfs | |
parent | 64f54e88c4b1db708b6d728ff52975cfc1bd8e60 (diff) |
(netfs_S_io_write): more fixup
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/io-write.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/libnetfs/io-write.c b/libnetfs/io-write.c index ebd6408b..c299d15c 100644 --- a/libnetfs/io-write.c +++ b/libnetfs/io-write.c @@ -31,14 +31,17 @@ netfs_S_io_write (struct protid *user, { error_t err; off_t off = offset; + struct node *np; if (!user) return EOPNOTSUPP; - mutex_lock (&user->po->np->lock); + np = user->po->np; + + mutex_lock (&np->lock); if ((user->po->openstat & O_WRITE) == 0) { - mutex_unlock (&user->po->np->lock); + mutex_unlock (&np->lock); return EBADF; } @@ -48,22 +51,21 @@ netfs_S_io_write (struct protid *user, { if (user->po->openstat & O_APPEND) { - err = netfs_validate_stat (np, user->po->np); + err = netfs_validate_stat (np, user->credential); if (err) { - mutex_unlock (&user->po->np->lock); + mutex_unlock (&np->lock); return err; } - user->po->filepointer = user->po->np->nn_stat.st_size; + user->po->filepointer = np->nn_stat.st_size; } off = user->po->filepointer; } - err = netfs_attempt_write (user->credential, user->po->np, - off, amount, data); + err = netfs_attempt_write (user->credential, np, off, amount, data); if (offset == -1 && !err) user->po->filepointer += *amount; - mutex_unlock (&user->po->np->lock); + mutex_unlock (&np->lock); return err; } |