svn commit: r239925 - projects/fuse/sys/fs/fuse
Attilio Rao
attilio at FreeBSD.org
Thu Aug 30 22:15:52 UTC 2012
Author: attilio
Date: Thu Aug 30 22:15:51 2012
New Revision: 239925
URL: http://svn.freebsd.org/changeset/base/239925
Log:
The current fifo support is completely broken.
As this is not really a needed feature in several filesystems and
it requires quite a bit of work to get fixed, remove the completely
half-backed support (which can of course results in panic).
In collabouration with: pho
Modified:
projects/fuse/sys/fs/fuse/fuse_kernel.h
projects/fuse/sys/fs/fuse/fuse_vnops.c
Modified: projects/fuse/sys/fs/fuse/fuse_kernel.h
==============================================================================
--- projects/fuse/sys/fs/fuse/fuse_kernel.h Thu Aug 30 22:05:51 2012 (r239924)
+++ projects/fuse/sys/fs/fuse/fuse_kernel.h Thu Aug 30 22:15:51 2012 (r239925)
@@ -192,11 +192,6 @@ struct fuse_attr_out {
struct fuse_attr attr;
};
-struct fuse_mknod_in {
- __u32 mode;
- __u32 rdev;
-};
-
struct fuse_mkdir_in {
__u32 mode;
__u32 padding;
Modified: projects/fuse/sys/fs/fuse/fuse_vnops.c
==============================================================================
--- projects/fuse/sys/fs/fuse/fuse_vnops.c Thu Aug 30 22:05:51 2012 (r239924)
+++ projects/fuse/sys/fs/fuse/fuse_vnops.c Thu Aug 30 22:15:51 2012 (r239925)
@@ -310,17 +310,17 @@ fuse_vnop_create(struct vop_create_args
struct ucred *cred = cnp->cn_cred;
struct fuse_open_in *foi;
- struct fuse_mknod_in fmni;
struct fuse_entry_out *feo;
struct fuse_dispatcher fdi;
struct fuse_dispatcher *fdip = &fdi;
int err;
- int gone_good_old = 0;
struct mount *mp = vnode_mount(dvp);
uint64_t parentnid = VTOFUD(dvp)->nid;
mode_t mode = MAKEIMODE(vap->va_type, vap->va_mode);
+ uint64_t x_fh_id;
+ uint32_t x_open_flags;
fuse_trace_printf_vnop();
@@ -330,8 +330,9 @@ fuse_vnop_create(struct vop_create_args
bzero(&fdi, sizeof(fdi));
/* XXX: Will we ever want devices ? */
- if ((vap->va_type != VREG) || !fsess_isimpl(mp, FUSE_CREATE)) {
- goto good_old;
+ if ((vap->va_type != VREG)) {
+ MPASS(vap->va_type != VFIFO);
+ goto bringup;
}
debug_printf("parent nid = %ju, mode = %x\n", (uintmax_t)parentnid,
mode);
@@ -339,7 +340,7 @@ fuse_vnop_create(struct vop_create_args
fdisp_init(fdip, sizeof(*foi) + cnp->cn_namelen + 1);
if (!fsess_isimpl(mp, FUSE_CREATE)) {
debug_printf("eh, daemon doesn't implement create?\n");
- goto good_old;
+ return (EINVAL);
}
fdisp_make(fdip, FUSE_CREATE, vnode_mount(dvp), parentnid, td, cred);
@@ -357,25 +358,10 @@ fuse_vnop_create(struct vop_create_args
debug_printf("create: got ENOSYS from daemon\n");
fsess_set_notimpl(mp, FUSE_CREATE);
fdisp_destroy(fdip);
- goto good_old;
} else if (err) {
debug_printf("create: darn, got err=%d from daemon\n", err);
goto out;
}
- goto bringup;
-
-good_old:
- gone_good_old = 1;
- fmni.mode = mode; /* fvdat->flags; */
- fmni.rdev = 0;
- fdisp_init(&fdi, 0);
- fuse_internal_newentry_makerequest(vnode_mount(dvp), parentnid, cnp,
- FUSE_MKNOD, &fmni, sizeof(fmni),
- fdip);
- err = fdisp_wait_answ(fdip);
- if (err) {
- goto out;
- }
bringup:
feo = fdip->answ;
@@ -384,36 +370,27 @@ bringup:
}
err = fuse_vnode_get(mp, feo->nodeid, dvp, vpp, cnp, VREG);
if (err) {
- if (gone_good_old) {
- fuse_internal_forget_send(mp, td, cred, feo->nodeid, 1);
- } else {
- struct fuse_release_in *fri;
- uint64_t nodeid = feo->nodeid;
- uint64_t fh_id = ((struct fuse_open_out *)(feo + 1))->fh;
-
- fdisp_init(fdip, sizeof(*fri));
- fdisp_make(fdip, FUSE_RELEASE, mp, nodeid, td, cred);
- fri = fdip->indata;
- fri->fh = fh_id;
- fri->flags = OFLAGS(mode);
- fuse_insert_callback(fdip->tick,
- fuse_internal_forget_callback);
- fuse_insert_message(fdip->tick);
- }
+ struct fuse_release_in *fri;
+ uint64_t nodeid = feo->nodeid;
+ uint64_t fh_id = ((struct fuse_open_out *)(feo + 1))->fh;
+
+ fdisp_init(fdip, sizeof(*fri));
+ fdisp_make(fdip, FUSE_RELEASE, mp, nodeid, td, cred);
+ fri = fdip->indata;
+ fri->fh = fh_id;
+ fri->flags = OFLAGS(mode);
+ fuse_insert_callback(fdip->tick, fuse_internal_forget_callback);
+ fuse_insert_message(fdip->tick);
return err;
}
ASSERT_VOP_ELOCKED(*vpp, "fuse_vnop_create");
- fdip->answ = gone_good_old ? NULL : feo + 1;
-
- if (!gone_good_old) {
- uint64_t x_fh_id = ((struct fuse_open_out *)(feo + 1))->fh;
- uint32_t x_open_flags = ((struct fuse_open_out *)
- (feo + 1))->open_flags;
+ fdip->answ = feo + 1;
- fuse_filehandle_init(*vpp, FUFH_RDWR, NULL, x_fh_id);
- fuse_vnode_open(*vpp, x_open_flags, td);
- }
+ x_fh_id = ((struct fuse_open_out *)(feo + 1))->fh;
+ x_open_flags = ((struct fuse_open_out *)(feo + 1))->open_flags;
+ fuse_filehandle_init(*vpp, FUFH_RDWR, NULL, x_fh_id);
+ fuse_vnode_open(*vpp, x_open_flags, td);
cache_purge_negative(dvp);
out:
@@ -1140,30 +1117,8 @@ fuse_vnop_mkdir(struct vop_mkdir_args *a
static int
fuse_vnop_mknod(struct vop_mknod_args *ap)
{
- struct vnode *dvp = ap->a_dvp;
- struct vnode **vpp = ap->a_vpp;
- struct componentname *cnp = ap->a_cnp;
- struct vattr *vap = ap->a_vap;
- struct fuse_mknod_in fmni;
-
- int err;
-
- fuse_trace_printf_vnop();
-
- if (fuse_isdeadfs(dvp)) {
- panic("FUSE: fuse_vnop_mknod(): called on a dead file system");
- }
- fmni.mode = MAKEIMODE(vap->va_type, vap->va_mode);
- fmni.rdev = vap->va_rdev;
-
- err = fuse_internal_newentry(dvp, vpp, cnp, FUSE_MKNOD, &fmni,
- sizeof(fmni), vap->va_type);
-
- if (err == 0) {
- fuse_invalidate_attr(dvp);
- }
- return err;
+ return (EINVAL);
}
More information about the svn-src-projects
mailing list