btrfs: add stub write function

Only does the parameter error checking.

Change-Id: Idee4a8e8e183d45c4a14236c32ff40e52ccb2555
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1534
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
brjhaiku
2020-09-19 15:47:20 +00:00
committed by Adrien Destugues
parent 5986ba8cb1
commit ba6665a3dd
@@ -1,4 +1,5 @@
/*
* Copyright 2019, Bharathi Ramana Joshi, [email protected]
* Copyright 2019, Les De Ridder, [email protected]
* Copyright 2017, Chế Vũ Gia Hy, [email protected].
* Copyright 2011, Jérôme Duval, [email protected].
@@ -532,6 +533,26 @@ btrfs_open(fs_volume* /*_volume*/, fs_vnode* _node, int openMode,
}
status_t
btrfs_write(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t pos,
const void* buffer, size_t* _length)
{
Volume* volume = (Volume*)_volume->private_volume;
Inode* inode = (Inode*)_node->private_node;
if (volume->IsReadOnly())
return B_READ_ONLY_DEVICE;
if (pos < 0)
return B_BAD_VALUE;
if (!inode->IsFile())
return B_BAD_VALUE;
return B_NOT_SUPPORTED;
}
static status_t
btrfs_read(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t pos,
void* buffer, size_t* _length)
@@ -1146,7 +1167,7 @@ fs_vnode_ops gBtrfsVnodeOps = {
&btrfs_close,
&btrfs_free_cookie,
&btrfs_read,
NULL, // fs_write,
&btrfs_write,
/* directory operations */
&btrfs_create_dir,