Revert "vfs: functions to change a vnode busy status and ID"

This reverts commit 8497a2cc28.

The VFS layer is not at all ready for this. Many places in the
code implicitly assume ino_t values will never change. This
functionality is only necessary for live shrinking of partitions,
which is a feature niche enough we do not need to worry about
implementing it in the first round of resizing (if ever.)
This commit is contained in:
Augustin Cavalier
2022-03-22 11:38:06 -04:00
parent c1c3f9812b
commit 92030a4a60
6 changed files with 0 additions and 96 deletions
-2
View File
@@ -330,8 +330,6 @@ extern status_t remove_vnode(fs_volume* volume, ino_t vnodeID);
extern status_t unremove_vnode(fs_volume* volume, ino_t vnodeID);
extern status_t get_vnode_removed(fs_volume* volume, ino_t vnodeID,
bool* _removed);
extern status_t mark_vnode_busy(fs_volume* volume, ino_t vnodeID, bool busy);
extern status_t change_vnode_id(fs_volume* volume, ino_t vnodeID, ino_t newID);
extern fs_volume* volume_for_vnode(fs_vnode* vnode);
extern status_t check_access_permissions(int accessMode, mode_t mode,
gid_t nodeGroupID, uid_t nodeUserID);
@@ -945,8 +945,6 @@
#define remove_vnode fssh_remove_vnode
#define unremove_vnode fssh_unremove_vnode
#define get_vnode_removed fssh_get_vnode_removed
#define mark_vnode_busy fssh_mark_vnode_busy
#define change_vnode_id fssh_change_vnode_id
#define volume_for_vnode fssh_volume_for_vnode
#define check_access_permissions fssh_check_access_permissions
#define read_pages fssh_read_pages
@@ -360,10 +360,6 @@ extern fssh_status_t fssh_unremove_vnode(fssh_fs_volume *volume,
fssh_vnode_id vnodeID);
extern fssh_status_t fssh_get_vnode_removed(fssh_fs_volume *volume,
fssh_vnode_id vnodeID, bool* removed);
extern fssh_status_t fssh_mark_vnode_busy(fssh_fs_volume* volume,
fssh_vnode_id vnodeID, bool busy);
extern fssh_status_t fssh_change_vnode_id(fssh_fs_volume* volume,
fssh_vnode_id vnodeID, fssh_vnode_id newID);
extern fssh_fs_volume* fssh_volume_for_vnode(fssh_fs_vnode *vnode);
extern fssh_status_t fssh_check_access_permissions(int accessMode,
fssh_mode_t mode, fssh_gid_t nodeGroupID,
-2
View File
@@ -52,8 +52,6 @@ public:
{ return fDevice; }
ino_t InodeId() const
{ return fInode; }
void SetVnodeID(ino_t id)
{ fInode = id; }
protected:
virtual void DeleteObject();
-41
View File
@@ -3990,47 +3990,6 @@ get_vnode_removed(fs_volume* volume, ino_t vnodeID, bool* _removed)
}
extern "C" status_t
mark_vnode_busy(fs_volume* volume, ino_t vnodeID, bool busy)
{
ReadLocker locker(sVnodeLock);
struct vnode* vnode = lookup_vnode(volume->id, vnodeID);
if (vnode == NULL)
return B_ENTRY_NOT_FOUND;
// are we trying to mark an already busy node busy again?
if (busy && vnode->IsBusy())
return B_BUSY;
vnode->Lock();
vnode->SetBusy(busy);
vnode->Unlock();
return B_OK;
}
extern "C" status_t
change_vnode_id(fs_volume* volume, ino_t vnodeID, ino_t newID)
{
WriteLocker locker(sVnodeLock);
struct vnode* vnode = lookup_vnode(volume->id, vnodeID);
if (vnode == NULL)
return B_ENTRY_NOT_FOUND;
sVnodeTable->Remove(vnode);
vnode->id = newID;
sVnodeTable->Insert(vnode);
if (vnode->cache != NULL && vnode->cache->type == CACHE_TYPE_VNODE)
((VMVnodeCache*)vnode->cache)->SetVnodeID(newID);
return B_OK;
}
extern "C" fs_volume*
volume_for_vnode(fs_vnode* _vnode)
{
-45
View File
@@ -2117,51 +2117,6 @@ fssh_get_vnode_removed(fssh_fs_volume *volume, fssh_vnode_id vnodeID, bool* remo
}
extern "C" fssh_status_t
fssh_mark_vnode_busy(fssh_fs_volume* volume, fssh_vnode_id vnodeID, bool busy)
{
fssh_mutex_lock(&sVnodeMutex);
struct vnode* vnode = lookup_vnode(volume->id, vnodeID);
if (vnode == NULL) {
fssh_mutex_unlock(&sVnodeMutex);
return FSSH_B_ENTRY_NOT_FOUND;
}
// are we trying to mark an already busy node busy again?
if (busy && vnode->busy) {
fssh_mutex_unlock(&sVnodeMutex);
return FSSH_B_BUSY;
}
vnode->busy = busy;
fssh_mutex_unlock(&sVnodeMutex);
return FSSH_B_OK;
}
extern "C" fssh_status_t
fssh_change_vnode_id(fssh_fs_volume* volume, fssh_vnode_id vnodeID,
fssh_vnode_id newID)
{
fssh_mutex_lock(&sVnodeMutex);
struct vnode* vnode = lookup_vnode(volume->id, vnodeID);
if (vnode == NULL) {
fssh_mutex_unlock(&sVnodeMutex);
return FSSH_B_ENTRY_NOT_FOUND;
}
hash_remove(sVnodeTable, vnode);
vnode->id = newID;
hash_insert(sVnodeTable, vnode);
fssh_mutex_unlock(&sVnodeMutex);
return FSSH_B_OK;
}
extern "C" fssh_fs_volume*
fssh_volume_for_vnode(fssh_fs_vnode *_vnode)
{