ffs_alloc.c (88138) | ffs_alloc.c (89306) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 | 1/* 2 * Copyright (c) 1982, 1986, 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * @(#)ffs_alloc.c 8.18 (Berkeley) 5/26/95 |
34 * $FreeBSD: head/sys/ufs/ffs/ffs_alloc.c 88138 2001-12-18 18:05:17Z mckusick $ | 34 * $FreeBSD: head/sys/ufs/ffs/ffs_alloc.c 89306 2002-01-13 11:58:06Z alfred $ |
35 */ 36 37#include "opt_quota.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/bio.h> 42#include <sys/buf.h> --- 1858 unchanged lines hidden (view full) --- 1901 return (error); 1902 if (cmd.version != FFS_CMD_VERSION) 1903 return (ERPCMISMATCH); 1904 if ((error = getvnode(curproc->p_fd, cmd.handle, &fp)) != 0) 1905 return (error); 1906 vn_start_write((struct vnode *)fp->f_data, &mp, V_WAIT); 1907 if (mp == 0 || strncmp(mp->mnt_stat.f_fstypename, "ufs", MFSNAMELEN)) { 1908 vn_finished_write(mp); | 35 */ 36 37#include "opt_quota.h" 38 39#include <sys/param.h> 40#include <sys/systm.h> 41#include <sys/bio.h> 42#include <sys/buf.h> --- 1858 unchanged lines hidden (view full) --- 1901 return (error); 1902 if (cmd.version != FFS_CMD_VERSION) 1903 return (ERPCMISMATCH); 1904 if ((error = getvnode(curproc->p_fd, cmd.handle, &fp)) != 0) 1905 return (error); 1906 vn_start_write((struct vnode *)fp->f_data, &mp, V_WAIT); 1907 if (mp == 0 || strncmp(mp->mnt_stat.f_fstypename, "ufs", MFSNAMELEN)) { 1908 vn_finished_write(mp); |
1909 fdrop(fp, curthread); |
|
1909 return (EINVAL); 1910 } 1911 if (mp->mnt_flag & MNT_RDONLY) { 1912 vn_finished_write(mp); | 1910 return (EINVAL); 1911 } 1912 if (mp->mnt_flag & MNT_RDONLY) { 1913 vn_finished_write(mp); |
1914 fdrop(fp, curthread); |
|
1913 return (EROFS); 1914 } 1915 ump = VFSTOUFS(mp); 1916 fs = ump->um_fs; 1917 filetype = IFREG; 1918 1919 switch (oidp->oid_number) { 1920 --- 115 unchanged lines hidden (view full) --- 2036 printf("Invalid request %d from fsck\n", 2037 oidp->oid_number); 2038 } 2039#endif /* DEBUG */ 2040 error = EINVAL; 2041 break; 2042 2043 } | 1915 return (EROFS); 1916 } 1917 ump = VFSTOUFS(mp); 1918 fs = ump->um_fs; 1919 filetype = IFREG; 1920 1921 switch (oidp->oid_number) { 1922 --- 115 unchanged lines hidden (view full) --- 2038 printf("Invalid request %d from fsck\n", 2039 oidp->oid_number); 2040 } 2041#endif /* DEBUG */ 2042 error = EINVAL; 2043 break; 2044 2045 } |
2046 fdrop(fp, curthread); |
|
2044 vn_finished_write(mp); 2045 return (error); 2046} | 2047 vn_finished_write(mp); 2048 return (error); 2049} |