msdosfs_vnops.c (164855) | msdosfs_vnops.c (166340) |
---|---|
1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_vnops.c 164855 2006-12-03 19:04:26Z maxim $ */ | 1/* $FreeBSD: head/sys/fs/msdosfs/msdosfs_vnops.c 166340 2007-01-30 03:11:45Z rodrigc $ */ |
2/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ 3 4/*- 5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. 6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 311 unchanged lines hidden (view full) --- 321 fileid = 1; 322 } else { 323 fileid = (uint64_t)cntobn(pmp, dep->de_dirclust) * 324 dirsperblk; 325 if (dep->de_dirclust == MSDOSFSROOT) 326 fileid = (uint64_t)roottobn(pmp, 0) * dirsperblk; 327 fileid += (uint64_t)dep->de_diroffset / sizeof(struct direntry); 328 } | 2/* $NetBSD: msdosfs_vnops.c,v 1.68 1998/02/10 14:10:04 mrg Exp $ */ 3 4/*- 5 * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank. 6 * Copyright (C) 1994, 1995, 1997 TooLs GmbH. 7 * All rights reserved. 8 * Original code by Paul Popelka (paulp@uts.amdahl.com) (see below). 9 * --- 311 unchanged lines hidden (view full) --- 321 fileid = 1; 322 } else { 323 fileid = (uint64_t)cntobn(pmp, dep->de_dirclust) * 324 dirsperblk; 325 if (dep->de_dirclust == MSDOSFSROOT) 326 fileid = (uint64_t)roottobn(pmp, 0) * dirsperblk; 327 fileid += (uint64_t)dep->de_diroffset / sizeof(struct direntry); 328 } |
329#ifdef MSDOSFS_LARGE 330 vap->va_fileid = msdosfs_fileno_map(pmp->pm_mountp, fileid); 331#else 332 vap->va_fileid = (long)fileid; 333#endif | 329 330 if (pmp->pm_flags & MSDOSFS_LARGEFS) 331 vap->va_fileid = msdosfs_fileno_map(pmp->pm_mountp, fileid); 332 else 333 vap->va_fileid = (long)fileid; 334 |
334 if ((dep->de_Attributes & ATTR_READONLY) == 0) 335 mode = S_IRWXU|S_IRWXG|S_IRWXO; 336 else 337 mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; 338 vap->va_mode = mode & 339 (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); 340 vap->va_uid = pmp->pm_uid; 341 vap->va_gid = pmp->pm_gid; --- 1224 unchanged lines hidden (view full) --- 1566 for (n = (int)offset / sizeof(struct direntry); 1567 n < 2; n++) { 1568 if (FAT32(pmp)) 1569 fileno = (uint64_t)cntobn(pmp, 1570 pmp->pm_rootdirblk) 1571 * dirsperblk; 1572 else 1573 fileno = 1; | 335 if ((dep->de_Attributes & ATTR_READONLY) == 0) 336 mode = S_IRWXU|S_IRWXG|S_IRWXO; 337 else 338 mode = S_IRUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH; 339 vap->va_mode = mode & 340 (ap->a_vp->v_type == VDIR ? pmp->pm_dirmask : pmp->pm_mask); 341 vap->va_uid = pmp->pm_uid; 342 vap->va_gid = pmp->pm_gid; --- 1224 unchanged lines hidden (view full) --- 1567 for (n = (int)offset / sizeof(struct direntry); 1568 n < 2; n++) { 1569 if (FAT32(pmp)) 1570 fileno = (uint64_t)cntobn(pmp, 1571 pmp->pm_rootdirblk) 1572 * dirsperblk; 1573 else 1574 fileno = 1; |
1574#ifdef MSDOSFS_LARGE 1575 dirbuf.d_fileno = msdosfs_fileno_map( 1576 pmp->pm_mountp, fileno); 1577#else 1578 dirbuf.d_fileno = (uint32_t)fileno; 1579#endif | 1575 if (pmp->pm_flags & MSDOSFS_LARGEFS) { 1576 dirbuf.d_fileno = 1577 msdosfs_fileno_map(pmp->pm_mountp, 1578 fileno); 1579 } else { 1580 1581 dirbuf.d_fileno = (uint32_t)fileno; 1582 } |
1580 dirbuf.d_type = DT_DIR; 1581 switch (n) { 1582 case 0: 1583 dirbuf.d_namlen = 1; 1584 strcpy(dirbuf.d_name, "."); 1585 break; 1586 case 1: 1587 dirbuf.d_namlen = 2; --- 107 unchanged lines hidden (view full) --- 1695 else 1696 fileno = (uint64_t)cntobn(pmp, fileno) * 1697 dirsperblk; 1698 dirbuf.d_type = DT_DIR; 1699 } else { 1700 fileno = (uint64_t)offset / sizeof(struct direntry); 1701 dirbuf.d_type = DT_REG; 1702 } | 1583 dirbuf.d_type = DT_DIR; 1584 switch (n) { 1585 case 0: 1586 dirbuf.d_namlen = 1; 1587 strcpy(dirbuf.d_name, "."); 1588 break; 1589 case 1: 1590 dirbuf.d_namlen = 2; --- 107 unchanged lines hidden (view full) --- 1698 else 1699 fileno = (uint64_t)cntobn(pmp, fileno) * 1700 dirsperblk; 1701 dirbuf.d_type = DT_DIR; 1702 } else { 1703 fileno = (uint64_t)offset / sizeof(struct direntry); 1704 dirbuf.d_type = DT_REG; 1705 } |
1703#ifdef MSDOSFS_LARGE 1704 dirbuf.d_fileno = msdosfs_fileno_map(pmp->pm_mountp, 1705 fileno); 1706#else 1707 dirbuf.d_fileno = (uint32_t)fileno; 1708#endif | 1706 if (pmp->pm_flags & MSDOSFS_LARGEFS) { 1707 dirbuf.d_fileno = 1708 msdosfs_fileno_map(pmp->pm_mountp, fileno); 1709 } else 1710 dirbuf.d_fileno = (uint32_t)fileno; 1711 |
1709 if (chksum != winChksum(dentp)) { 1710 dirbuf.d_namlen = dos2unixfn(dentp->deName, 1711 (u_char *)dirbuf.d_name, 1712 dentp->deLowerCase | 1713 ((pmp->pm_flags & MSDOSFSMNT_SHORTNAME) ? 1714 (LCASE_BASE | LCASE_EXT) : 0), 1715 pmp); 1716 mbnambuf_init(); --- 220 unchanged lines hidden --- | 1712 if (chksum != winChksum(dentp)) { 1713 dirbuf.d_namlen = dos2unixfn(dentp->deName, 1714 (u_char *)dirbuf.d_name, 1715 dentp->deLowerCase | 1716 ((pmp->pm_flags & MSDOSFSMNT_SHORTNAME) ? 1717 (LCASE_BASE | LCASE_EXT) : 0), 1718 pmp); 1719 mbnambuf_init(); --- 220 unchanged lines hidden --- |