Displaying 20 results from an estimated 31 matches for "btrfs_ioctl_magic".
2010 Jul 26
6
[PATCH] Btrfs: compressed file size ioctl
...ge(inode, 0, len);
}
with
btrfs_wait_ordered_range(inode, 0, (u64)-1);
- return the uncompressed size on disk for uncompressed filesystems instead
of EINVAL
Minimal example:
#include <sys/ioctl.h>
#include <fcntl.h>
#include <stdint.h>
#include <stdio.h>
#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_IOC_COMPR_SIZE _IOR(BTRFS_IOCTL_MAGIC, 21, uint64_t)
int main(int argc, char **argv)
{
uint64_t size = -1;
int d = open(argv[1], O_RDONLY);
ioctl(d, BTRFS_IOC_COMPR_SIZE, &size);
printf("%zd\n", size);
return 0;
}
Signed-off-by: Ulrich Hecht <uli@su...
2013 Oct 25
8
[PATCH] btrfs: add framework to read fs info from btrfs-control
...st {
+ __u64 self_sz; /* in/out */
+ __u8 fsid[BTRFS_FSID_SIZE]; /* out */
+ __u64 num_devices;
+ __u64 missing_devices;
+ __u64 total_devices;
+ __u64 flags;
+};
+
+struct btrfs_ioctl_fslist_args {
+ __u64 self_sz; /* in/out */
+ __u64 count; /* out */
+};
+
#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -606,5 +623,7 @@ static inline char *btrfs_err_str(enum btrfs_err_code err_code)
struct btrfs_ioctl_dev_replace_args)
#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \...
2010 Dec 14
0
[PATCH] BTRFS_IOC_TREE_SEARCH: store and use the last key found
...lds */
+ __u32 start_type;
+ __u64 start_objectid;
+ __u64 start_offset;
/* some extra for later */
- __u64 unused1;
- __u64 unused2;
__u64 unused3;
__u64 unused4;
};
@@ -182,7 +182,12 @@ struct btrfs_ioctl_space_args {
struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_DEFRAG_RANGE _IOW(BTRFS_IOCTL_MAGIC, 16, \
struct btrfs_ioctl_defrag_range_args)
-#define BTRFS_IOC_TREE_SEARCH _IOWR(BTRFS_IOCTL_MAGIC, 17, \
+
+/* buggy, don''t use */
+
+#define BTRFS_IOC_TREE_SEARCH_V0 _IOWR(BTRFS_IOCTL_MAGIC, 17, \
+ struct btrfs_ioctl_search_args)
+#define BTRFS_IOC_TREE_SEARCH_V1 _IOWR(BTRFS...
2010 Mar 22
5
[PATCH 0/5] asynchronous commit, snapshot ponies
Hi everyone,
This patchset is the latest approach I''m using for the Ceph storage daemon to
keep track of which data has safely committed to disk. The basic idea is to
not use the (problematic) user transaction ioctls at all. Instead, the daemon
quiesces its own write requests, initiates an async snapshot, and then
continues.
The snapshot approach is nice because it provides rollback.
2012 Nov 01
41
[Request for review] [RFC] Add label support for snapshots and subvols
From: Anand Jain <anand.jain@oracle.com>
(This patch is for the review/test not yet for the integration).
Here is an implementation of the feature to add label to the
subvolume and snapshots. Which would help sysadmin to better manager
the subvol and snapshots.
This can be done in two ways, one - using attr which is user land
only changes but drawback is able to change the label
2011 Jan 06
3
Offline Deduplication for Btrfs V2
Just a quick update, I''ve dropped the hashing stuff in favor of doing a memcmp
in the kernel to make sure the data is still the same. The thing that takes a
while is reading the data up from disk, so doing a memcmp of the entire buffer
isn''t that big of a deal, not to mention there''s a possiblity for malicious
users if there is a problem with the hashing algorithms we
2013 Oct 16
0
[BUG] Reflinking fails for files >2GB on 32-bit platform
...;
bool os_create_reflink(const char* linkname, const char* fname)
{
int src_desc=open(fname, O_RDONLY);
if( src_desc<0)
return false;
int dst_desc=open(linkname, O_WRONLY | O_CREAT | O_EXCL, S_IRWXU | S_IRWXG);
if( dst_desc<0 )
{
close(src_desc);
return false;
}
#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_IOC_CLONE _IOW (BTRFS_IOCTL_MAGIC, 9, int)
int rc=ioctl(dst_desc, BTRFS_IOC_CLONE, src_desc);
close(src_desc);
close(dst_desc);
return rc==0;
}
int main(int argc, char* argv[])
{
if(argc<3)
{
std::cout << "not enough arguments: reflink [source...
2014 Apr 23
0
[PATCH 001/001] btrfs: Mechanism to modify the permission of a subvolume
...6/include/uapi/linux/btrfs.h 2014-03-07 11:37:02.000000000 +0530
+++ linux-3.13.6_btrfs/include/uapi/linux/btrfs.h 2014-03-19 15:34:30.648255239 +0530
@@ -606,5 +606,7 @@ static inline char *btrfs_err_str(enum b
struct btrfs_ioctl_dev_replace_args)
#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
struct btrfs_ioctl_same_args)
+#define BTRFS_IOC_SUBVOL_MODIFY _IOW(BTRFS_IOCTL_MAGIC, 55, \
+ struct btrfs_ioctl_vol_args_v2)
#endif /* _UAPI_LINUX_BTRFS_H */
2009 Jun 13
1
[PATCH 1/3] Add ioctl to set per file 'compress' flag
...RESS, 0);
}
return -ENOTTY;
Index: newformat2/fs/btrfs/ioctl.h
===================================================================
--- newformat2.orig/fs/btrfs/ioctl.h
+++ newformat2/fs/btrfs/ioctl.h
@@ -65,5 +65,7 @@ struct btrfs_ioctl_clone_range_args {
#define BTRFS_IOC_SUBVOL_CREATE _IOW(BTRFS_IOCTL_MAGIC, 14, \
struct btrfs_ioctl_vol_args)
+#define BTRFS_IOC_COMPRESS _IOW(BTRFS_IOCTL_MAGIC, 15, \
+ struct btrfs_ioctl_vol_args)
#endif
--
May the source be with you.
http://www.cis.ksu.edu/~gud
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the...
2013 Jun 26
6
[PROGS PATCH] Import btrfs-extent-same
...;sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <stddef.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/ioctl.h>
+
+#define BTRFS_IOCTL_MAGIC 0x94
+
+#define BTRFS_IOC_FILE_EXTENT_SAME _IOWR(BTRFS_IOCTL_MAGIC, 54, \
+ struct btrfs_ioctl_same_args)
+
+#define BTRFS_SAME_DATA_DIFFERS 1
+/* For extent-same ioctl */
+struct btrfs_ioctl_same_extent_info {
+ int64_t fd; /* in - destination file */
+ uint64_t logical_offset; /* in - star...
2011 Jul 07
5
[PATCH v1 0/2] Btrfs-progs: commands "resolve inode" and "resolve logical"
The kernel patch series just sent (Subject: "Btrfs: scrub: print path to
corrupted files and trigger nodatasum fixup") introduces two new ioctls to
do in-kernel filesystem path construction. This series provides the
corresponding userspace changes, adding two new commands to the btrfs utility:
--
btrfs resolve inode [-v] <inode> <path>
resolves an <inode> to all
2012 May 25
6
[PATCH v5 0/3] Btrfs: add IO error device stats
Changes v1-v2:
- Remove restriction that BTRFS_IOC_GET_DEVICE_STATS is a privileged
operation
- Cast u64 to unsigned long long for printf()
Changes v2-v3:
- Rebased on Chris'' current master
Changes v3-v4:
- Add padding at end of ioctl structure
Changes v4-v5:
- The statistic members in the ioctl are now organized as an array of
64 bit values. Symbolic names for the array indexes
2013 Apr 25
10
[PATCH v4 0/3] Btrfs: quota rescan for 3.10
The kernel side for rescan, which is needed if you want to enable qgroup
tracking on a non-empty volume. The first patch splits
btrfs_qgroup_account_ref into readable ans reusable units. The second
patch adds the rescan implementation (refer to its commit message for a
description of the algorithm). The third patch starts an automatic
rescan when qgroups are enabled. It is only separated to
2011 Dec 09
10
[PATCH 0/3] Btrfs: add IO error device stats
The goal is to detect when drives start to get an increased error rate,
when drives should be replaced soon. Therefore statistic counters are
added that count IO errors (read, write and flush). Additionally, the
software detected errors like checksum errors and corrupted blocks are
counted.
An ioctl interface is added to get the device statistic counters.
A second ioctl is added to atomically get
2010 Oct 25
14
[PATCH 0/6] Btrfs commit fixes, async subvol operations
Hi Chris,
This is the extent of my current queue of Btrfs snapshot/subvol/commit
stuff. Most of these were posted several months ago. Can be sent
upstream during this merge window? Not having this functionality is
becoming a bit of a roadblock for our efforts to keep the Ceph data in a
consistent state.
These patches are also available from
2012 Aug 01
17
[PATCH] add crtime to the snapshot list
From: Anand <anand.jain@oracle.com>
This patch adds creation-time to the snapshot list display,
which would help user to better manage the snapshots when
number of snapshots grow substantially. This patch is developed
and on top of the send/receive btrfs and btrfs-progs repo at
git://github.com/ablock84/linux-btrfs.git (send-v2)
git://github.com/ablock84/btrfs-progs.git (send-v2)
2012 Feb 03
10
[PATCH 0/3] Btrfs-progs: restriper interface
Hello,
This is the userspace part of restriper, rebased onto the new progs
infrastructure. Restriper commands are located under ''balance'' prefix,
which is now the top level command group. However to not confuse
existing users ''balance'' prefix is also available under ''filesystem'':
btrfs [filesystem] balance start
btrfs [filesystem] balance
2011 Jul 18
5
[PATCH v3 0/5] btrfs-progs: scrub interface
This is the next patch series for scrub userland tools.
Change log v1->v2:
- commands now reachable as "btrfs scrub ..." instead of "btrfs filesystem
scrub ..."
- ability to scrub a single device instead of a whole file system
- superfluous command line options removed
- resume is now a separate command ("scrub resume") instead of "scrub start -r"
-
2011 Jul 12
0
[PATCH]: Use a general way to get the default subvolume for btrfs
...__le16 name_len;
+ u8 type;
+} __attribute__ ((__packed__));
+
struct btrfs_super_block {
unsigned char csum[BTRFS_CSUM_SIZE];
/* the first 3 fields must match struct btrfs_header */
@@ -19,4 +56,72 @@ struct btrfs_super_block {
u64 magic;
} __attribute__ ((__packed__));
+
+#define BTRFS_IOCTL_MAGIC 0x94
+#define BTRFS_VOL_NAME_MAX 255
+#define BTRFS_PATH_NAME_MAX 4087
+
+struct btrfs_ioctl_vol_args {
+ __s64 fd;
+ char name[BTRFS_PATH_NAME_MAX + 1];
+};
+
+struct btrfs_ioctl_search_key {
+ /* which root are we searching. 0 is the tree of tree roots */
+ __u64 tree_id;
+
+ /* keys returned wi...
2010 Sep 28
18
[PATCH] Btrfs: add a disk info ioctl to get the disks attached to a filesystem
...h
index 424694a..294e8c3 100644
--- a/fs/btrfs/ioctl.h
+++ b/fs/btrfs/ioctl.h
@@ -138,6 +138,11 @@ struct btrfs_ioctl_space_args {
struct btrfs_ioctl_space_info spaces[0];
};
+struct btrfs_ioctl_disk_info_args {
+ __u32 num_devices;
+ __u64 devices[0];
+};
+
#define BTRFS_IOC_SNAP_CREATE _IOW(BTRFS_IOCTL_MAGIC, 1, \
struct btrfs_ioctl_vol_args)
#define BTRFS_IOC_DEFRAG _IOW(BTRFS_IOCTL_MAGIC, 2, \
@@ -178,4 +183,6 @@ struct btrfs_ioctl_space_args {
#define BTRFS_IOC_DEFAULT_SUBVOL _IOW(BTRFS_IOCTL_MAGIC, 19, u64)
#define BTRFS_IOC_SPACE_INFO _IOWR(BTRFS_IOCTL_MAGIC, 20, \
struct btrfs...