Displaying 7 results from an estimated 7 matches for "test_issubvolume".
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...ar *path, int devfd, struct stat *rst)
return 0;
}
+/*
+ * * test if path is a subvolume:
+ * * this function return
+ * * 0-> path exists but it is not a subvolume
+ * * 1-> path exists and it is a subvolume
+ * * -1 -> path is unaccessible
+ * */
+static int test_issubvolume(char *path)
+{
+
+ struct stat st;
+ int res;
+
+ res = stat(path, &st);
+ if(res < 0 )
+ return -1;
+
+ return (st.st_ino == 256) && S_ISDIR(st.st_mode);
+
+}
+
+/*
+ * Get file handle for a file or dir
+ */
+static i...
2015 Nov 15
0
[PATCH] extlinux/main.c: space chance
...,7 @@ bail:
* * test if path is a subvolume:
* * this function return
* * 0-> path exists but it is not a subvolume
- * * 1-> path exists and it is a subvolume
+ * * 1-> path exists and it is a subvolume
* * -1 -> path is unaccessible
* */
static int test_issubvolume(char *path)
@@ -1385,8 +1385,8 @@ static int open_device(const char *path, struct stat *st, char **_devname)
if (!fs_type) {
fprintf(stderr,
- "%s: not a fat, ntfs, ext2/3/4, btrfs, xfs or"
- "ufs1/2 filesystem: %s\n",
+ "%s: not a fat, ntfs, ext2/3/4, btrfs, xf...
2013 Nov 16
16
[PATCH] BTRFS-PROG: recursively subvolume snapshot and delete
Hi All,
the following patches implement the recursively snapshotting and
deleting of a subvolume.
To snapshot recursively you must pass the -R switch:
# btrfs subvolume create sub1
Create subvolume ''./sub1''
# btrfs subvolume create sub1/sub2
Create subvolume ''sub1/sub2''
# btrfs subvolume snapshot -R sub1 sub1-snap
Create a snapshot of
2010 Dec 11
1
[RFC] Improve btrfs subvolume find-new command
...directory."
diff --git a/btrfs_cmds.c b/btrfs_cmds.c
index 8031c58..9bcc280 100644
--- a/btrfs_cmds.c
+++ b/btrfs_cmds.c
@@ -247,16 +247,90 @@ int do_defrag(int ac, char **av)
return errors + 20;
}
+static int _get_latest_gen(char *subvol, u64 *max_found)
+{
+ int fd;
+ int ret;
+
+ ret = test_issubvolume(subvol);
+ if (ret < 0) {
+ fprintf(stderr, "ERROR: error accessing ''%s''\n", subvol);
+ return 12;
+ }
+ if (!ret) {
+ fprintf(stderr, "ERROR: ''%s'' is not a subvolume\n", subvol);
+ return 13;
+ }
+
+ fd = open_file_or_dir(subvol);
+ if...
2015 Nov 13
2
[patch] 6.03 extlinux/main.c typos
...7 +750,7 @@
* * test if path is a subvolume:
* * this function return
* * 0-> path exists but it is not a subvolume
- * * 1-> path exists and it is a subvolume
+ * * 1-> path exists and it is a subvolume
* * -1 -> path is unaccessible
* */
static int test_issubvolume(char *path)
@@ -1373,8 +1373,8 @@
if (!fs_type) {
fprintf(stderr,
- "%s: not a fat, ntfs, ext2/3/4, btrfs, xfs or"
- "ufs1/2 filesystem: %s\n",
+ "%s: not a fat, ntfs, ext2/3/4, btrfs, xfs"
+ " or ufs1/2 filesystem: %s\n",
program, path);
re...
2012 Feb 29
15
[RFC] [PATCH] Add btrfs autosnap feature
From: anand jain <anand.jain@oracle.com>
Anand Jain (1):
[RFC] Add btrfs autosnap feature
Makefile | 6 +-
autosnap.c | 1553 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
autosnap.h | 81 +++
btrfs-list.c | 140 +++++-
btrfs.c | 46 ++-
btrfs_cmds.c | 186 +++++++-
btrfs_cmds.h | 3 +-
scrub.c | 1 +
8 files changed, 1982 insertions(+), 34
2015 Nov 15
4
[patch] 6.03 extlinux/main.c typos
On Fri, Nov 13, 2015 at 06:14:36AM +0100, Geert Stappers via Syslinux wrote:
> On Fri, Nov 13, 2015 at 05:05:26AM +0200, Ady via Syslinux wrote:
> > diff U3 syslinux-6.03/extlinux/main.c syslinux-6.03_typo/extlinux/main.c
> > --- syslinux-6.03/extlinux/main.c Mon Oct 06 16:27:44 2014
> > +++ syslinux-6.03_typo/extlinux/main.c Fri Nov 13 02:29:56 2015
>
> patch seen
>