blob: 9303b17dd209afd77ed044c3e2f088c9d46d40f8 [file] [log] [blame]
rsc46f79932005-01-04 21:22:40 +00001/* Copyright (C) 2003 Russ Cox, Massachusetts Institute of Technology */
2/* See COPYRIGHT */
3
4#include <u.h>
5#include <libc.h>
6#include <fcall.h>
7#include <9pclient.h>
8#include "fsimpl.h"
9
10static void
11fidclunk(CFid *fid)
12{
13 Fcall tx, rx;
14
15 tx.type = Tclunk;
16 tx.fid = fid->fid;
17 _fsrpc(fid->fs, &tx, &rx, 0);
18 _fsputfid(fid);
19}
20
21void
22fsclose(CFid *fid)
23{
24 if(fid == nil)
25 return;
26
27 /* maybe someday there will be a ref count */
28 fidclunk(fid);
29}
rsc86122472006-01-27 04:08:41 +000030
31int
32fsfremove(CFid *fid)
33{
34 int n;
35 Fcall tx, rx;
36
37 tx.type = Tremove;
38 tx.fid = fid->fid;
39 n = _fsrpc(fid->fs, &tx, &rx, 0);
40 _fsputfid(fid);
41 return n;
42}