mirror of
https://git.sr.ht/~cismonx/bookmarkfs
synced 2025-06-07 19:58:50 +00:00
backend_firefox: fix directory deletion
Also reverts commit fef7b4d3a8
.
The DELETE_DIR flag is in fact useful, but bookmark_delete()
incorrectly checked CREATE_DIR instead.
This commit is contained in:
parent
bd80cbf2c1
commit
2e3685f217
3 changed files with 8 additions and 7 deletions
|
@ -58,6 +58,7 @@
|
|||
#define BOOKMARKFS_FRONTEND_MKFS ( 1u << 18 )
|
||||
|
||||
#define BOOKMARKFS_BOOKMARK_CREATE_DIR ( 1u << 0 )
|
||||
#define BOOKMARKFS_BOOKMARK_DELETE_DIR ( 1u << 0 )
|
||||
#define BOOKMARKFS_BOOKMARK_LIST_WITHSTAT ( 1u << 0 )
|
||||
#define BOOKMARKFS_BOOKMARK_RENAME_NOREPLACE ( 1u << 0 )
|
||||
#define BOOKMARKFS_BOOKMARK_SET_ATIME ( 1u << 0 )
|
||||
|
|
|
@ -3422,8 +3422,8 @@ bookmark_delete (
|
|||
return status;
|
||||
}
|
||||
|
||||
size_t name_len = strlen(name);
|
||||
bool is_dir = flags & BOOKMARK_FLAG(CREATE_DIR);
|
||||
size_t name_len = strlen(name);
|
||||
bool is_dir = flags & BOOKMARK_FLAG(DELETE_DIR);
|
||||
switch (flags & BOOKMARKFS_BOOKMARK_TYPE_MASK) {
|
||||
case BOOKMARKFS_BOOKMARK_TYPE(TAG):
|
||||
if (!is_dir) {
|
||||
|
|
10
src/fs_ops.c
10
src/fs_ops.c
|
@ -235,7 +235,7 @@ static int bm_setattr (uint64_t, int, bool, struct fuse_file_info const *,
|
|||
static int bm_setxattr (uint64_t, char const *, void const *, size_t, int);
|
||||
static int bm_write (fuse_req_t, int, char const *, size_t, off_t,
|
||||
struct fs_file_handle *);
|
||||
static void do_delete (fuse_req_t, fuse_ino_t, char const *);
|
||||
static void do_delete (fuse_req_t, fuse_ino_t, char const *, uint32_t);
|
||||
static void do_readdir (fuse_req_t, fuse_ino_t, size_t, off_t, uint32_t,
|
||||
struct fuse_file_info const *);
|
||||
static unsigned long
|
||||
|
@ -1206,11 +1206,11 @@ static void
|
|||
do_delete (
|
||||
fuse_req_t req,
|
||||
fuse_ino_t parent,
|
||||
char const *name
|
||||
char const *name,
|
||||
uint32_t flags
|
||||
) {
|
||||
int status = -EIO;
|
||||
|
||||
uint32_t flags = 0;
|
||||
switch (INODE_SUBSYS_TYPE(parent)) {
|
||||
case SUBSYS_TYPE_INTERNAL:
|
||||
status = intfs_delete(INODE_SUBSYS_ID(parent), name, flags);
|
||||
|
@ -2306,7 +2306,7 @@ fs_op_rmdir (
|
|||
fuse_ino_t parent,
|
||||
char const *name
|
||||
) {
|
||||
do_delete(req, parent, name);
|
||||
do_delete(req, parent, name, BOOKMARK_FLAG(DELETE_DIR));
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -2367,7 +2367,7 @@ fs_op_unlink (
|
|||
fuse_ino_t parent,
|
||||
char const *name
|
||||
) {
|
||||
do_delete(req, parent, name);
|
||||
do_delete(req, parent, name, 0);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
Loading…
Add table
Reference in a new issue