Changeset 596 for trunk/server/source3/smbd/vfs.c
- Timestamp:
- Jul 2, 2011, 3:35:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/smbd/vfs.c
r454 r596 583 583 } 584 584 585 #ifdef S_ISFIFO 586 if (S_ISFIFO(st.st_ex_mode)) { 587 return 0; 588 } 589 #endif 590 585 591 DEBUG(10,("vfs_fill_sparse: write zeros in file %s from len %.0f to " 586 592 "len %.0f (%.0f bytes)\n", fsp_str_dbg(fsp), … … 591 597 592 598 flush_write_cache(fsp, SIZECHANGE_FLUSH); 599 600 601 offset = st.st_ex_size; 602 num_to_write = len - st.st_ex_size; 603 604 /* Only do this on non-stream file handles. */ 605 if (fsp->base_fsp == NULL) { 606 /* for allocation try posix_fallocate first. This can fail on some 607 * platforms e.g. when the filesystem doesn't support it and no 608 * emulation is being done by the libc (like on AIX with JFS1). In that 609 * case we do our own emulation. posix_fallocate implementations can 610 * return ENOTSUP or EINVAL in cases like that. */ 611 ret = sys_posix_fallocate(fsp->fh->fd, offset, num_to_write); 612 if (ret == ENOSPC) { 613 errno = ENOSPC; 614 ret = -1; 615 goto out; 616 } 617 if (ret == 0) { 618 set_filelen_write_cache(fsp, len); 619 goto out; 620 } 621 622 DEBUG(10,("vfs_fill_sparse: sys_posix_fallocate failed with " 623 "error %d. Falling back to slow manual allocation\n", ret)); 624 } 593 625 594 626 if (!sparse_buf) { … … 601 633 } 602 634 603 offset = st.st_ex_size;604 num_to_write = len - st.st_ex_size;605 635 total = 0; 606 636 … … 933 963 } 934 964 default: 935 DEBUG( 1,("check_reduced_name: couldn't get "965 DEBUG(3,("check_reduced_name: couldn't get " 936 966 "realpath for %s\n", fname)); 937 967 return map_nt_error_from_unix(errno);
Note:
See TracChangeset
for help on using the changeset viewer.