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 <pulkomandy@gmail.com>
This commit is contained in:
parent
5986ba8cb1
commit
ba6665a3dd
@ -1,4 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
|
* Copyright 2019, Bharathi Ramana Joshi, joshibharathiramana@gmail.com
|
||||||
* Copyright 2019, Les De Ridder, les@lesderid.net
|
* Copyright 2019, Les De Ridder, les@lesderid.net
|
||||||
* Copyright 2017, Chế Vũ Gia Hy, cvghy116@gmail.com.
|
* Copyright 2017, Chế Vũ Gia Hy, cvghy116@gmail.com.
|
||||||
* Copyright 2011, Jérôme Duval, korli@users.berlios.de.
|
* Copyright 2011, Jérôme Duval, korli@users.berlios.de.
|
||||||
@ -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
|
static status_t
|
||||||
btrfs_read(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t pos,
|
btrfs_read(fs_volume* _volume, fs_vnode* _node, void* _cookie, off_t pos,
|
||||||
void* buffer, size_t* _length)
|
void* buffer, size_t* _length)
|
||||||
@ -1146,7 +1167,7 @@ fs_vnode_ops gBtrfsVnodeOps = {
|
|||||||
&btrfs_close,
|
&btrfs_close,
|
||||||
&btrfs_free_cookie,
|
&btrfs_free_cookie,
|
||||||
&btrfs_read,
|
&btrfs_read,
|
||||||
NULL, // fs_write,
|
&btrfs_write,
|
||||||
|
|
||||||
/* directory operations */
|
/* directory operations */
|
||||||
&btrfs_create_dir,
|
&btrfs_create_dir,
|
||||||
|
Loading…
Reference in New Issue
Block a user