Allow large file on 32 bit systems

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Cleanup some unused code and variables

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Use flags in a consistent way

Previously code was assuming flags from Linux and from ext was the same.
Assume they are not the same and use proper macro and defines for ext mode.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Remove some warning converting some data

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Fix creation of hard links

File type was missing from links.
Number of links must be incremented manually.

Signed-off-by: Frediano Ziglio <frediano.ziglio@citrix.com>
Check chdir return code.