Ignore:
Timestamp:
Jul 2, 2011, 3:35:33 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/smbd/vfs.c

    r454 r596  
    583583        }
    584584
     585#ifdef S_ISFIFO
     586        if (S_ISFIFO(st.st_ex_mode)) {
     587                return 0;
     588        }
     589#endif
     590
    585591        DEBUG(10,("vfs_fill_sparse: write zeros in file %s from len %.0f to "
    586592                  "len %.0f (%.0f bytes)\n", fsp_str_dbg(fsp),
     
    591597
    592598        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        }
    593625
    594626        if (!sparse_buf) {
     
    601633        }
    602634
    603         offset = st.st_ex_size;
    604         num_to_write = len - st.st_ex_size;
    605635        total = 0;
    606636
     
    933963                        }
    934964                        default:
    935                                 DEBUG(1,("check_reduced_name: couldn't get "
     965                                DEBUG(3,("check_reduced_name: couldn't get "
    936966                                         "realpath for %s\n", fname));
    937967                                return map_nt_error_from_unix(errno);
Note: See TracChangeset for help on using the changeset viewer.