PERFORCE change 193903 for review
Ilya Putsikau
ilya at FreeBSD.org
Sun May 29 11:08:30 UTC 2011
http://p4web.freebsd.org/@@193903?ac=10
Change 193903 by ilya at ilya_triton2011 on 2011/05/29 11:07:24
Move fuse_init_handler and fuse_send_init to fuse_internal
Affected files ...
.. //depot/projects/soc2011/ilya_fuse/fuse_module/Makefile#9 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.c#1 add
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.h#3 edit
.. //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#6 edit
Differences ...
==== //depot/projects/soc2011/ilya_fuse/fuse_module/Makefile#9 (text+ko) ====
@@ -13,6 +13,7 @@
fuse_ipc.h \
fuse_file.h \
fuse_internal.h \
+ fuse_internal.c \
fuse_io.h \
fuse_node.h \
vnode_if.h
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_internal.h#3 (text+ko) ====
@@ -6,6 +6,13 @@
#ifndef _FUSE_INTERNAL_H_
#define _FUSE_INTERNAL_H_
+#include <sys/types.h>
+#include <sys/uio.h>
+#include <sys/vnode.h>
+
+#include "fuse_ipc.h"
+#include "fuse_node.h"
+
/* access related data */
#define FACCESS_VA_VALID 0x01 /* flag to sign to reuse cached attributes
@@ -28,4 +35,8 @@
unsigned facc_flags;
};
+
+int fuse_init_handler(struct fuse_ticket *tick, struct uio *uio);
+void fuse_send_init(struct fuse_data *data, struct thread *td);
+
#endif /* _FUSE_INTERNAL_H_ */
==== //depot/projects/soc2011/ilya_fuse/fuse_module/fuse_vfsops.c#6 (text+ko) ====
@@ -23,6 +23,7 @@
#include "fuse.h"
#include "fuse_node.h"
#include "fuse_ipc.h"
+#include "fuse_internal.h"
#include <sys/priv.h>
#include <security/mac/mac_framework.h>
@@ -40,8 +41,6 @@
#endif
-static int fuse_init_handler(struct fuse_ticket *tick, struct uio *uio);
-static void fuse_send_init(struct fuse_data *data, struct thread *td);
static vfs_hash_cmp_t fuse_vnode_bgdrop_cmp;
static vfs_mount_t fuse_mount;
@@ -70,65 +69,6 @@
extern struct vop_vector fuse_vnops;
-
-/********************
- *
- * >>> callback handlers for VFS ops
- *
- ********************/
-
-static int
-fuse_init_handler(struct fuse_ticket *tick, struct uio *uio)
-{
- struct fuse_data *data = tick->tk_data;
-#if FUSE_KERNELABI_GEQ(7, 5)
- struct fuse_init_out *fiio;
-#else
- struct fuse_init_in_out *fiio;
-#endif
- int err = 0;
-
- if ((err = tick->tk_aw_ohead.error))
- goto out;
- if ((err = fticket_pull(tick, uio)))
- goto out;
-
- fiio = fticket_resp(tick)->base;
-
- /* XXX is the following check adequate? */
- if (fiio->major < 7) {
- DEBUG2G("userpace version too low\n");
- err = EPROTONOSUPPORT;
- goto out;
- }
-
- data->fuse_libabi_major = fiio->major;
- data->fuse_libabi_minor = fiio->minor;
-
- if (FUSE_KERNELABI_GEQ(7, 5) && fuse_libabi_geq(data, 7, 5)) {
-#if FUSE_KERNELABI_GEQ(7, 5)
- if (fticket_resp(tick)->len == sizeof(struct fuse_init_out))
- data->max_write = fiio->max_write;
- else
- err = EINVAL;
-#endif
- } else
- /* Old fix values */
- data->max_write = 4096;
-
-out:
- fuse_ticket_drop(tick);
- if (err)
- fdata_kick_set(data);
-
- mtx_lock(&data->ticket_mtx);
- data->dataflag |= FSESS_INITED;
- wakeup(&data->ticketer);
- mtx_unlock(&data->ticket_mtx);
-
- return (0);
-}
-
/******************
*
* >>> VFS hash comparators
@@ -186,26 +126,6 @@
*
*************/
-static __inline void
-fuse_send_init(struct fuse_data *data, struct thread *td)
-{
-#if FUSE_KERNELABI_GEQ(7, 5)
- struct fuse_init_in *fiii;
-#else
- struct fuse_init_in_out *fiii;
-#endif
- struct fuse_dispatcher fdi;
-
- fdisp_init(&fdi, sizeof(*fiii));
- fdisp_make(&fdi, data->mp, FUSE_INIT, 0, td, NULL);
- fiii = fdi.indata;
- fiii->major = FUSE_KERNEL_VERSION;
- fiii->minor = FUSE_KERNEL_MINOR_VERSION;
-
- fuse_insert_callback(fdi.tick, fuse_init_handler);
- fuse_insert_message(fdi.tick);
-}
-
/*
* Mount system call
*/
More information about the p4-projects
mailing list