From owner-svn-src-head@freebsd.org Sun Feb 26 09:42:35 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B7FA4CEBDC1; Sun, 26 Feb 2017 09:42:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92BE66E5; Sun, 26 Feb 2017 09:42:35 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v1Q9gYPR032859; Sun, 26 Feb 2017 09:42:34 GMT (envelope-from dchagin@FreeBSD.org) Received: (from dchagin@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v1Q9gYnq032858; Sun, 26 Feb 2017 09:42:34 GMT (envelope-from dchagin@FreeBSD.org) Message-Id: <201702260942.v1Q9gYnq032858@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dchagin set sender to dchagin@FreeBSD.org using -f From: Dmitry Chagin Date: Sun, 26 Feb 2017 09:42:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r314294 - head/sys/compat/linux X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2017 09:42:35 -0000 Author: dchagin Date: Sun Feb 26 09:42:34 2017 New Revision: 314294 URL: https://svnweb.freebsd.org/changeset/base/314294 Log: Nostly style(9) changes, replace unused eventfd_truncate() by default invfo_truncate() method. MFC after: 1 month Modified: head/sys/compat/linux/linux_event.c Modified: head/sys/compat/linux/linux_event.c ============================================================================== --- head/sys/compat/linux/linux_event.c Sun Feb 26 09:40:42 2017 (r314293) +++ head/sys/compat/linux/linux_event.c Sun Feb 26 09:42:34 2017 (r314294) @@ -123,7 +123,6 @@ typedef uint64_t eventfd_t; static fo_rdwr_t eventfd_read; static fo_rdwr_t eventfd_write; -static fo_truncate_t eventfd_truncate; static fo_ioctl_t eventfd_ioctl; static fo_poll_t eventfd_poll; static fo_kqfilter_t eventfd_kqfilter; @@ -134,7 +133,7 @@ static fo_fill_kinfo_t eventfd_fill_kinf static struct fileops eventfdops = { .fo_read = eventfd_read, .fo_write = eventfd_write, - .fo_truncate = eventfd_truncate, + .fo_truncate = invfo_truncate, .fo_ioctl = eventfd_ioctl, .fo_poll = eventfd_poll, .fo_kqfilter = eventfd_kqfilter, @@ -207,7 +206,7 @@ epoll_create_common(struct thread *td, i int error; error = kern_kqueue(td, flags, NULL); - if (error) + if (error != 0) return (error); epoll_fd_install(td, EPOLL_DEF_SZ, 0); @@ -378,7 +377,7 @@ epoll_kev_copyin(void *arg, struct keven struct epoll_copyin_args *args; args = (struct epoll_copyin_args*) arg; - + memcpy(kevp, args->changelist, count * sizeof(*kevp)); args->changelist += count; @@ -438,7 +437,7 @@ linux_epoll_ctl(struct thread *td, struc * EVFILT_READ and EVFILT_WRITE, ignoring any errors */ error = epoll_delete_all_events(td, epfp, args->fd); - if (error) + if (error != 0) goto leave0; /* FALLTHROUGH */ @@ -458,7 +457,7 @@ linux_epoll_ctl(struct thread *td, struc error = epoll_to_kevent(td, epfp, args->fd, &le, &kev_flags, kev, &nchanges); - if (error) + if (error != 0) goto leave0; epoll_fd_install(td, args->fd, le.data); @@ -622,7 +621,7 @@ eventfd_create(struct thread *td, uint32 fdp = td->td_proc->p_fd; error = falloc(td, &fp, &fd, fflags); - if (error) + if (error != 0) return (error); efd = malloc(sizeof(*efd), M_EPOLL, M_WAITOK | M_ZERO); @@ -681,7 +680,7 @@ eventfd_close(struct file *fp, struct th static int eventfd_read(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) + int flags, struct thread *td) { struct eventfd *efd; eventfd_t count; @@ -727,7 +726,7 @@ retry: static int eventfd_write(struct file *fp, struct uio *uio, struct ucred *active_cred, - int flags, struct thread *td) + int flags, struct thread *td) { struct eventfd *efd; eventfd_t count; @@ -741,7 +740,7 @@ eventfd_write(struct file *fp, struct ui return (EINVAL); error = uiomove(&count, sizeof(eventfd_t), uio); - if (error) + if (error != 0) return (error); if (count == UINT64_MAX) return (EINVAL); @@ -773,7 +772,7 @@ retry: static int eventfd_poll(struct file *fp, int events, struct ucred *active_cred, - struct thread *td) + struct thread *td) { struct eventfd *efd; int revents = 0; @@ -862,17 +861,8 @@ filt_eventfdwrite(struct knote *kn, long /*ARGSUSED*/ static int -eventfd_truncate(struct file *fp, off_t length, struct ucred *active_cred, - struct thread *td) -{ - - return (ENXIO); -} - -/*ARGSUSED*/ -static int eventfd_ioctl(struct file *fp, u_long cmd, void *data, - struct ucred *active_cred, struct thread *td) + struct ucred *active_cred, struct thread *td) { struct eventfd *efd; @@ -897,7 +887,7 @@ eventfd_ioctl(struct file *fp, u_long cm /*ARGSUSED*/ static int eventfd_stat(struct file *fp, struct stat *st, struct ucred *active_cred, - struct thread *td) + struct thread *td) { return (ENXIO);