aboutsummaryrefslogtreecommitdiffstats
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorSatoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>2014-08-01 11:58:00 +0900
committerDavid Sterba <dsterba@suse.cz>2014-08-22 15:07:04 +0200
commitc2d83207bf964e6c0624ce870a01ac1b13ab165b (patch)
tree709a053bf9a72c423f37ed09dbd122d0476acf51 /cmds-subvolume.c
parent91b33340576e9c59353a89f0edb7b72a5a60ad3f (diff)
downloadbtrfs-progs-c2d83207bf964e6c0624ce870a01ac1b13ab165b.tar.gz
btrfs-progs-c2d83207bf964e6c0624ce870a01ac1b13ab165b.tar.xz
btrfs-progs-c2d83207bf964e6c0624ce870a01ac1b13ab165b.zip
btrfs-progs: move test_isdir() to utils.c
Since test_isdir() is a utility function, it's better to move it to utils.c. In addition, "const char *" is more appropriate type as its "path" argument because this argument is not changed in this function. Signed-off-by: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com> Cc: David Sterba <dsterba@suse.cz> Cc: Mike Fleetwood <mike.fleetwood@googlemail.com> Signed-off-by: David Sterba <dsterba@suse.cz>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c19
1 files changed, 0 insertions, 19 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index 29ded12..0d4a52e 100644
--- a/cmds-subvolume.c
+++ b/cmds-subvolume.c
@@ -41,25 +41,6 @@ static const char * const subvolume_cmd_group_usage[] = {
NULL
};
-/*
- * test if path is a directory
- * this function return
- * 0-> path exists but it is not a directory
- * 1-> path exists and it is a directory
- * -1 -> path is unaccessible
- */
-static int test_isdir(char *path)
-{
- struct stat st;
- int res;
-
- res = stat(path, &st);
- if(res < 0 )
- return -1;
-
- return S_ISDIR(st.st_mode);
-}
-
static const char * const cmd_subvol_create_usage[] = {
"btrfs subvolume create [-i <qgroupid>] [<dest>/]<name>",
"Create a subvolume",