msdosfs_vnops.c (30492) | msdosfs_vnops.c (30513) |
---|---|
1/* $Id: msdosfs_vnops.c,v 1.48 1997/10/16 10:48:52 phk Exp $ */ | 1/* $Id: msdosfs_vnops.c,v 1.49 1997/10/16 20:32:31 phk Exp $ */ |
2/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ 3 4/*- 5 * Copyright (C) 1994 Wolfgang Solfrank. 6 * Copyright (C) 1994 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 79 unchanged lines hidden (view full) --- 89static int msdosfs_remove __P((struct vop_remove_args *)); 90static int msdosfs_link __P((struct vop_link_args *)); 91static int msdosfs_rename __P((struct vop_rename_args *)); 92static int msdosfs_mkdir __P((struct vop_mkdir_args *)); 93static int msdosfs_rmdir __P((struct vop_rmdir_args *)); 94static int msdosfs_symlink __P((struct vop_symlink_args *)); 95static int msdosfs_readdir __P((struct vop_readdir_args *)); 96static int msdosfs_abortop __P((struct vop_abortop_args *)); | 2/* $NetBSD: msdosfs_vnops.c,v 1.20 1994/08/21 18:44:13 ws Exp $ */ 3 4/*- 5 * Copyright (C) 1994 Wolfgang Solfrank. 6 * Copyright (C) 1994 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 79 unchanged lines hidden (view full) --- 89static int msdosfs_remove __P((struct vop_remove_args *)); 90static int msdosfs_link __P((struct vop_link_args *)); 91static int msdosfs_rename __P((struct vop_rename_args *)); 92static int msdosfs_mkdir __P((struct vop_mkdir_args *)); 93static int msdosfs_rmdir __P((struct vop_rmdir_args *)); 94static int msdosfs_symlink __P((struct vop_symlink_args *)); 95static int msdosfs_readdir __P((struct vop_readdir_args *)); 96static int msdosfs_abortop __P((struct vop_abortop_args *)); |
97static int msdosfs_lock __P((struct vop_lock_args *)); 98static int msdosfs_unlock __P((struct vop_unlock_args *)); | |
99static int msdosfs_bmap __P((struct vop_bmap_args *)); 100static int msdosfs_strategy __P((struct vop_strategy_args *)); 101static int msdosfs_print __P((struct vop_print_args *)); | 97static int msdosfs_bmap __P((struct vop_bmap_args *)); 98static int msdosfs_strategy __P((struct vop_strategy_args *)); 99static int msdosfs_print __P((struct vop_print_args *)); |
102static int msdosfs_islocked __P((struct vop_islocked_args *)); | |
103static int msdosfs_pathconf __P((struct vop_pathconf_args *ap)); 104 105/* 106 * Some general notes: 107 * 108 * In the ufs filesystem the inodes, superblocks, and indirect blocks are 109 * read/written using the vnode for the filesystem. Blocks that represent 110 * the contents of a file are read/written using the vnode for the file --- 1593 unchanged lines hidden (view full) --- 1704 struct componentname *a_cnp; 1705 } */ *ap; 1706{ 1707 if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) 1708 zfree(namei_zone, ap->a_cnp->cn_pnbuf); 1709 return 0; 1710} 1711 | 100static int msdosfs_pathconf __P((struct vop_pathconf_args *ap)); 101 102/* 103 * Some general notes: 104 * 105 * In the ufs filesystem the inodes, superblocks, and indirect blocks are 106 * read/written using the vnode for the filesystem. Blocks that represent 107 * the contents of a file are read/written using the vnode for the file --- 1593 unchanged lines hidden (view full) --- 1701 struct componentname *a_cnp; 1702 } */ *ap; 1703{ 1704 if ((ap->a_cnp->cn_flags & (HASBUF | SAVESTART)) == HASBUF) 1705 zfree(namei_zone, ap->a_cnp->cn_pnbuf); 1706 return 0; 1707} 1708 |
1712static int 1713msdosfs_lock(ap) 1714 struct vop_lock_args /* { 1715 struct vnode *a_vp; 1716 int a_flags; 1717 struct proc *a_p; 1718 } */ *ap; 1719{ 1720 struct vnode *vp = ap->a_vp; 1721 1722 return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags, &vp->v_interlock, 1723 ap->a_p)); 1724} 1725 1726int 1727msdosfs_unlock(ap) 1728 struct vop_unlock_args /* { 1729 struct vnode *a_vp; 1730 int a_flags; 1731 struct proc *a_p; 1732 } */ *ap; 1733{ 1734 struct vnode *vp = ap->a_vp; 1735 1736 return (lockmgr(&VTODE(vp)->de_lock, ap->a_flags | LK_RELEASE, 1737 &vp->v_interlock, ap->a_p)); 1738} 1739 1740int 1741msdosfs_islocked(ap) 1742 struct vop_islocked_args /* { 1743 struct vnode *a_vp; 1744 } */ *ap; 1745{ 1746 1747 return (lockstatus(&VTODE(ap->a_vp)->de_lock)); 1748} 1749 | |
1750/* 1751 * vp - address of vnode file the file 1752 * bn - which cluster we are interested in mapping to a filesystem block number. 1753 * vpp - returns the vnode for the block special file holding the filesystem 1754 * containing the file of interest 1755 * bnp - address of where to return the filesystem relative block number 1756 */ 1757static int --- 121 unchanged lines hidden (view full) --- 1879 { &vop_access_desc, (vop_t *) msdosfs_access }, 1880 { &vop_bmap_desc, (vop_t *) msdosfs_bmap }, 1881 { &vop_cachedlookup_desc, (vop_t *) msdosfs_lookup }, 1882 { &vop_close_desc, (vop_t *) msdosfs_close }, 1883 { &vop_create_desc, (vop_t *) msdosfs_create }, 1884 { &vop_fsync_desc, (vop_t *) msdosfs_fsync }, 1885 { &vop_getattr_desc, (vop_t *) msdosfs_getattr }, 1886 { &vop_inactive_desc, (vop_t *) msdosfs_inactive }, | 1709/* 1710 * vp - address of vnode file the file 1711 * bn - which cluster we are interested in mapping to a filesystem block number. 1712 * vpp - returns the vnode for the block special file holding the filesystem 1713 * containing the file of interest 1714 * bnp - address of where to return the filesystem relative block number 1715 */ 1716static int --- 121 unchanged lines hidden (view full) --- 1838 { &vop_access_desc, (vop_t *) msdosfs_access }, 1839 { &vop_bmap_desc, (vop_t *) msdosfs_bmap }, 1840 { &vop_cachedlookup_desc, (vop_t *) msdosfs_lookup }, 1841 { &vop_close_desc, (vop_t *) msdosfs_close }, 1842 { &vop_create_desc, (vop_t *) msdosfs_create }, 1843 { &vop_fsync_desc, (vop_t *) msdosfs_fsync }, 1844 { &vop_getattr_desc, (vop_t *) msdosfs_getattr }, 1845 { &vop_inactive_desc, (vop_t *) msdosfs_inactive }, |
1887 { &vop_islocked_desc, (vop_t *) msdosfs_islocked }, | 1846 { &vop_islocked_desc, (vop_t *) vop_stdislocked }, |
1888 { &vop_link_desc, (vop_t *) msdosfs_link }, | 1847 { &vop_link_desc, (vop_t *) msdosfs_link }, |
1889 { &vop_lock_desc, (vop_t *) msdosfs_lock }, | 1848 { &vop_lock_desc, (vop_t *) vop_stdlock }, |
1890 { &vop_lookup_desc, (vop_t *) vfs_cache_lookup }, 1891 { &vop_mkdir_desc, (vop_t *) msdosfs_mkdir }, 1892 { &vop_mknod_desc, (vop_t *) msdosfs_mknod }, 1893 { &vop_pathconf_desc, (vop_t *) msdosfs_pathconf }, 1894 { &vop_print_desc, (vop_t *) msdosfs_print }, 1895 { &vop_read_desc, (vop_t *) msdosfs_read }, 1896 { &vop_readdir_desc, (vop_t *) msdosfs_readdir }, 1897 { &vop_reclaim_desc, (vop_t *) msdosfs_reclaim }, 1898 { &vop_remove_desc, (vop_t *) msdosfs_remove }, 1899 { &vop_rename_desc, (vop_t *) msdosfs_rename }, 1900 { &vop_rmdir_desc, (vop_t *) msdosfs_rmdir }, 1901 { &vop_setattr_desc, (vop_t *) msdosfs_setattr }, 1902 { &vop_strategy_desc, (vop_t *) msdosfs_strategy }, 1903 { &vop_symlink_desc, (vop_t *) msdosfs_symlink }, | 1849 { &vop_lookup_desc, (vop_t *) vfs_cache_lookup }, 1850 { &vop_mkdir_desc, (vop_t *) msdosfs_mkdir }, 1851 { &vop_mknod_desc, (vop_t *) msdosfs_mknod }, 1852 { &vop_pathconf_desc, (vop_t *) msdosfs_pathconf }, 1853 { &vop_print_desc, (vop_t *) msdosfs_print }, 1854 { &vop_read_desc, (vop_t *) msdosfs_read }, 1855 { &vop_readdir_desc, (vop_t *) msdosfs_readdir }, 1856 { &vop_reclaim_desc, (vop_t *) msdosfs_reclaim }, 1857 { &vop_remove_desc, (vop_t *) msdosfs_remove }, 1858 { &vop_rename_desc, (vop_t *) msdosfs_rename }, 1859 { &vop_rmdir_desc, (vop_t *) msdosfs_rmdir }, 1860 { &vop_setattr_desc, (vop_t *) msdosfs_setattr }, 1861 { &vop_strategy_desc, (vop_t *) msdosfs_strategy }, 1862 { &vop_symlink_desc, (vop_t *) msdosfs_symlink }, |
1904 { &vop_unlock_desc, (vop_t *) msdosfs_unlock }, | 1863 { &vop_unlock_desc, (vop_t *) vop_stdunlock }, |
1905 { &vop_write_desc, (vop_t *) msdosfs_write }, 1906 { NULL, NULL } 1907}; 1908static struct vnodeopv_desc msdosfs_vnodeop_opv_desc = 1909 { &msdosfs_vnodeop_p, msdosfs_vnodeop_entries }; 1910 1911VNODEOP_SET(msdosfs_vnodeop_opv_desc); | 1864 { &vop_write_desc, (vop_t *) msdosfs_write }, 1865 { NULL, NULL } 1866}; 1867static struct vnodeopv_desc msdosfs_vnodeop_opv_desc = 1868 { &msdosfs_vnodeop_p, msdosfs_vnodeop_entries }; 1869 1870VNODEOP_SET(msdosfs_vnodeop_opv_desc); |