Lines 187-193
Link Here
|
187 |
SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_misses, CTLFLAG_RD, |
187 |
SYSCTL_ULONG(_vfs_fuse, OID_AUTO, lookup_cache_misses, CTLFLAG_RD, |
188 |
&fuse_lookup_cache_misses, 0, ""); |
188 |
&fuse_lookup_cache_misses, 0, ""); |
189 |
|
189 |
|
190 |
int fuse_lookup_cache_enable = 1; |
190 |
int fuse_lookup_cache_enable = 0; |
191 |
|
191 |
|
192 |
SYSCTL_INT(_vfs_fuse, OID_AUTO, lookup_cache_enable, CTLFLAG_RW, |
192 |
SYSCTL_INT(_vfs_fuse, OID_AUTO, lookup_cache_enable, CTLFLAG_RW, |
193 |
&fuse_lookup_cache_enable, 0, ""); |
193 |
&fuse_lookup_cache_enable, 0, ""); |
Lines 302-310
Link Here
|
302 |
" (fflag=0x%x)\n", |
302 |
" (fflag=0x%x)\n", |
303 |
fufh_type, fflag); |
303 |
fufh_type, fflag); |
304 |
} |
304 |
} |
305 |
if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { |
305 |
// if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { |
306 |
fuse_vnode_savesize(vp, cred); |
306 |
// fuse_vnode_savesize(vp, cred); |
307 |
} |
307 |
// } |
308 |
return 0; |
308 |
return 0; |
309 |
} |
309 |
} |
310 |
|
310 |
|
Lines 527-536
Link Here
|
527 |
err = ENOENT; |
527 |
err = ENOENT; |
528 |
goto out; |
528 |
goto out; |
529 |
} |
529 |
} |
530 |
if ((fvdat->flag & FN_SIZECHANGE) != 0) |
530 |
// if ((fvdat->flag & FN_SIZECHANGE) != 0) |
531 |
vap->va_size = fvdat->filesize; |
531 |
// vap->va_size = fvdat->filesize; |
532 |
|
532 |
|
533 |
if (vnode_isreg(vp) && (fvdat->flag & FN_SIZECHANGE) == 0) { |
533 |
if (vnode_isreg(vp)/* && (fvdat->flag & FN_SIZECHANGE) == 0*/) { |
534 |
/* |
534 |
/* |
535 |
* This is for those cases when the file size changed without us |
535 |
* This is for those cases when the file size changed without us |
536 |
* knowing, and we want to catch up. |
536 |
* knowing, and we want to catch up. |
Lines 578-586
Link Here
|
578 |
fufh = &(fvdat->fufh[type]); |
578 |
fufh = &(fvdat->fufh[type]); |
579 |
if (FUFH_IS_VALID(fufh)) { |
579 |
if (FUFH_IS_VALID(fufh)) { |
580 |
if (need_flush && vp->v_type == VREG) { |
580 |
if (need_flush && vp->v_type == VREG) { |
581 |
if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { |
581 |
// if ((VTOFUD(vp)->flag & FN_SIZECHANGE) != 0) { |
582 |
fuse_vnode_savesize(vp, NULL); |
582 |
// fuse_vnode_savesize(vp, NULL); |
583 |
} |
583 |
// } |
584 |
if (fuse_data_cache_invalidate || |
584 |
if (fuse_data_cache_invalidate || |
585 |
(fvdat->flag & FN_REVOKED) != 0) |
585 |
(fvdat->flag & FN_REVOKED) != 0) |
586 |
fuse_io_invalbuf(vp, td); |
586 |
fuse_io_invalbuf(vp, td); |
Lines 823-828
Link Here
|
823 |
|
823 |
|
824 |
struct fuse_entry_out *feo = NULL; |
824 |
struct fuse_entry_out *feo = NULL; |
825 |
struct fuse_attr *fattr = NULL; |
825 |
struct fuse_attr *fattr = NULL; |
|
|
826 |
struct fuse_vnode_data *fvdat = NULL; |
826 |
|
827 |
|
827 |
if (op == FUSE_GETATTR) { |
828 |
if (op == FUSE_GETATTR) { |
828 |
fattr = &((struct fuse_attr_out *)fdi.answ)->attr; |
829 |
fattr = &((struct fuse_attr_out *)fdi.answ)->attr; |
Lines 971-976
Link Here
|
971 |
cache_attrs(*vpp, (struct fuse_entry_out *)fdi.answ); |
972 |
cache_attrs(*vpp, (struct fuse_entry_out *)fdi.answ); |
972 |
} |
973 |
} |
973 |
|
974 |
|
|
|
975 |
fvdat = VTOFUD(*vpp); |
976 |
|
977 |
if (vnode_isreg(*vpp)/* && (fvdat->flag & FN_SIZECHANGE) == 0*/) { |
978 |
/* |
979 |
* This is for those cases when the file size changed without us |
980 |
* knowing, and we want to catch up. |
981 |
*/ |
982 |
off_t new_filesize = fattr->size; |
983 |
|
984 |
if (fvdat->filesize != new_filesize) { |
985 |
fuse_vnode_setsize(*vpp, cred, new_filesize); |
986 |
} |
987 |
} |
974 |
/* Insert name into cache if appropriate. */ |
988 |
/* Insert name into cache if appropriate. */ |
975 |
|
989 |
|
976 |
/* |
990 |
/* |
Lines 1652-1658
Link Here
|
1652 |
fdisp_destroy(&fdi); |
1666 |
fdisp_destroy(&fdi); |
1653 |
if (!err && sizechanged) { |
1667 |
if (!err && sizechanged) { |
1654 |
fuse_vnode_setsize(vp, cred, newsize); |
1668 |
fuse_vnode_setsize(vp, cred, newsize); |
1655 |
VTOFUD(vp)->flag &= ~FN_SIZECHANGE; |
1669 |
// VTOFUD(vp)->flag &= ~FN_SIZECHANGE; |
1656 |
} |
1670 |
} |
1657 |
return err; |
1671 |
return err; |
1658 |
} |
1672 |
} |
Lines 1677-1684
Link Here
|
1677 |
bufdone(bp); |
1691 |
bufdone(bp); |
1678 |
return ENXIO; |
1692 |
return ENXIO; |
1679 |
} |
1693 |
} |
1680 |
if (bp->b_iocmd == BIO_WRITE) |
1694 |
// if (bp->b_iocmd == BIO_WRITE) |
1681 |
fuse_vnode_refreshsize(vp, NOCRED); |
1695 |
// fuse_vnode_refreshsize(vp, NOCRED); |
1682 |
|
1696 |
|
1683 |
(void)fuse_io_strategy(vp, bp); |
1697 |
(void)fuse_io_strategy(vp, bp); |
1684 |
|
1698 |
|
Lines 1765-1771
Link Here
|
1765 |
if (fuse_isdeadfs(vp)) { |
1779 |
if (fuse_isdeadfs(vp)) { |
1766 |
return ENXIO; |
1780 |
return ENXIO; |
1767 |
} |
1781 |
} |
1768 |
fuse_vnode_refreshsize(vp, cred); |
1782 |
// fuse_vnode_refreshsize(vp, cred); |
1769 |
|
1783 |
|
1770 |
if (VTOFUD(vp)->flag & FN_DIRECTIO) { |
1784 |
if (VTOFUD(vp)->flag & FN_DIRECTIO) { |
1771 |
ioflag |= IO_DIRECT; |
1785 |
ioflag |= IO_DIRECT; |