From: Dmitry V. Levin Date: Sat, 6 Dec 2014 03:53:16 +0000 (+0000) Subject: file.c: move fallocate parser to a separate file X-Git-Tag: v4.10~334 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2795a5f7ac529d1e69162bb7fd907a2e19bda8a1;p=strace file.c: move fallocate parser to a separate file * fallocate.c: New file. * Makefile.am (strace_SOURCES): Add it. * file.c (sys_fallocate): Move to fallocate.c. --- diff --git a/Makefile.am b/Makefile.am index d250125f..f4e7c775 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,6 +25,7 @@ strace_SOURCES = \ count.c \ desc.c \ dirent.c \ + fallocate.c \ fanotify.c \ file.c \ inotify.c \ diff --git a/fallocate.c b/fallocate.c new file mode 100644 index 00000000..c906cc53 --- /dev/null +++ b/fallocate.c @@ -0,0 +1,14 @@ +#include "defs.h" + +int +sys_fallocate(struct tcb *tcp) +{ + if (entering(tcp)) { + int argn; + printfd(tcp, tcp->u_arg[0]); /* fd */ + tprintf(", %#lo, ", tcp->u_arg[1]); /* mode */ + argn = printllval(tcp, "%llu, ", 2); /* offset */ + printllval(tcp, "%llu", argn); /* len */ + } + return 0; +} diff --git a/file.c b/file.c index d748db7b..70050ffc 100644 --- a/file.c +++ b/file.c @@ -1913,16 +1913,3 @@ sys_sync_file_range2(struct tcb *tcp) } return 0; } - -int -sys_fallocate(struct tcb *tcp) -{ - if (entering(tcp)) { - int argn; - printfd(tcp, tcp->u_arg[0]); /* fd */ - tprintf(", %#lo, ", tcp->u_arg[1]); /* mode */ - argn = printllval(tcp, "%llu, ", 2); /* offset */ - printllval(tcp, "%llu", argn); /* len */ - } - return 0; -}