• L
    Clean up write_in_full() users · d34cf19b
    Linus Torvalds 提交于
    With the new-and-improved write_in_full() semantics, where a partial write
    simply always returns a real error (and always sets 'errno' when that
    happens, including for the disk full case), a lot of the callers of
    write_in_full() were just unnecessarily complex.
    
    In particular, there's no reason to ever check for a zero length or
    return: if the length was zero, we'll return zero, otherwise, if a disk
    full resulted in the actual write() system call returning zero the
    write_in_full() logic would have correctly turned that into a negative
    return value, with 'errno' set to ENOSPC.
    
    I really wish every "write_in_full()" user would just check against "<0"
    now, but this fixes the nasty and stupid ones.
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    Signed-off-by: NJunio C Hamano <junkio@cox.net>
    d34cf19b
sha1_file.c 48.6 KB