Klaus Demo nginx / c66a1e7
Workaround for fs_size on ZFS (ticket #46). ZFS reports incorrect st_blocks until file settles on disk, and this may take a while (i.e. just after creation of a file the st_blocks value is incorrect). As a workaround we now use st_blocks only if st_blocks * 512 > st_size, this should fix ZFS problems while still preserving accuracy for other filesystems. The problem had appeared in r3900 (1.0.1). Maxim Dounin 10 years ago
1 changed file(s) with 3 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
179179 #define ngx_is_exec(sb) (((sb)->st_mode & S_IXUSR) == S_IXUSR)
180180 #define ngx_file_access(sb) ((sb)->st_mode & 0777)
181181 #define ngx_file_size(sb) (sb)->st_size
182 #define ngx_file_fs_size(sb) ((sb)->st_blocks * 512)
182 #define ngx_file_fs_size(sb) ngx_max((sb)->st_size, (sb)->st_blocks * 512)
183183 #define ngx_file_mtime(sb) (sb)->st_mtime
184184 #define ngx_file_uniq(sb) (sb)->st_ino
185185
275275
276276 #define ngx_de_access(dir) (((dir)->info.st_mode) & 0777)
277277 #define ngx_de_size(dir) (dir)->info.st_size
278 #define ngx_de_fs_size(dir) ((dir)->info.st_blocks * 512)
278 #define ngx_de_fs_size(dir) \
279 ngx_max((dir)->info.st_size, (dir)->info.st_blocks * 512)
279280 #define ngx_de_mtime(dir) (dir)->info.st_mtime
280281
281282