From owner-p4-projects@FreeBSD.ORG Sun May 29 11:08:30 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 4E0501065674; Sun, 29 May 2011 11:08:30 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC6361065670 for ; Sun, 29 May 2011 11:08:29 +0000 (UTC) (envelope-from ilya@FreeBSD.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id DA0698FC0C for ; Sun, 29 May 2011 11:08:29 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p4TB8TZq081380 for ; Sun, 29 May 2011 11:08:29 GMT (envelope-from ilya@FreeBSD.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p4TB8TmC081377 for perforce@freebsd.org; Sun, 29 May 2011 11:08:29 GMT (envelope-from ilya@FreeBSD.org) Date: Sun, 29 May 2011 11:08:29 GMT Message-Id: <201105291108.p4TB8TmC081377@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to ilya@FreeBSD.org using -f From: Ilya Putsikau To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 193903 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 29 May 2011 11:08:30 -0000 http://p4web.freebsd.org/@@193903?ac=10 Change 193903 by ilya@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 +#include +#include + +#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 #include @@ -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 */