diff --git a/fs/jffs2/src/vfs_jffs2.c b/fs/jffs2/src/vfs_jffs2.c index 58133d4ef65aba9c8952c5142295960a406cdb08..9af683b85ee434d25b94542f5303fac6083c956a 100644 --- a/fs/jffs2/src/vfs_jffs2.c +++ b/fs/jffs2/src/vfs_jffs2.c @@ -145,7 +145,6 @@ int VfsJffs2Bind(struct Mount *mnt, struct Vnode *blkDriver, const void *data) g_jffs2PartList[partNo] = blkDriver; - PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d\n", __FUNCTION__, __LINE__, pv, rootNode, rootNode->i_nlink); LOS_MuxUnlock(&g_jffs2FsLock); return 0; @@ -220,6 +219,9 @@ int VfsJffs2Lookup(struct Vnode *parentVnode, const char *path, int len, struct Jffs2SetVtype(node, newVnode); node->i_vnode = newVnode; + if (&g_jffs2Vops != parentVnode->vop) { + LOS_Panic("jffs2 vop failed"); + } newVnode->vop = parentVnode->vop; newVnode->fop = parentVnode->fop; newVnode->data = node; @@ -232,7 +234,6 @@ int VfsJffs2Lookup(struct Vnode *parentVnode, const char *path, int len, struct (void)VfsHashInsert(newVnode, node->i_ino); *ppVnode = newVnode; - PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d path=%s\n", __FUNCTION__, __LINE__, newVnode, node, node->i_nlink, path); LOS_MuxUnlock(&g_jffs2FsLock); return 0; @@ -260,6 +261,9 @@ int VfsJffs2Create(struct Vnode *parentVnode, const char *path, int mode, struct newVnode->type = VNODE_TYPE_REG; newNode->i_vnode = newVnode; newVnode->vop = parentVnode->vop; + if (&g_jffs2Vops != parentVnode->vop) { + LOS_Panic("jffs2 vop failed"); + } newVnode->fop = parentVnode->fop; newVnode->data = newNode; newVnode->parent = parentVnode; @@ -271,7 +275,6 @@ int VfsJffs2Create(struct Vnode *parentVnode, const char *path, int mode, struct (void)VfsHashInsert(newVnode, newNode->i_ino); *ppVnode = newVnode; - PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d path=%s\n", __FUNCTION__, __LINE__, newVnode, newNode, newNode->i_nlink, path); LOS_MuxUnlock(&g_jffs2FsLock); return 0; @@ -531,6 +534,9 @@ int VfsJffs2Mkdir(struct Vnode *parentNode, const char *dirName, mode_t mode, st newVnode->type = VNODE_TYPE_DIR; node->i_vnode = newVnode; newVnode->vop = parentNode->vop; + if (&g_jffs2Vops != parentNode->vop) { + LOS_Panic("jffs2 vop failed"); + } newVnode->fop = parentNode->fop; newVnode->data = node; newVnode->parent = parentNode; @@ -542,7 +548,6 @@ int VfsJffs2Mkdir(struct Vnode *parentNode, const char *dirName, mode_t mode, st *ppVnode = newVnode; (void)VfsHashInsert(newVnode, node->i_ino); - PRINTK("%s-%d: vnode=%p, inode=%p, i_nlink=%d path=%s\n", __FUNCTION__, __LINE__, newVnode, node, node->i_nlink, dirName); LOS_MuxUnlock(&g_jffs2FsLock); @@ -597,8 +602,6 @@ int VfsJffs2Chattr(struct Vnode *pVnode, struct IATTR *attr) return ret; } -extern struct Vnode *g_parentOfCoveredVnode; - int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, char *path) { int ret; @@ -609,10 +612,6 @@ int VfsJffs2Rmdir(struct Vnode *parentVnode, struct Vnode *targetVnode, char *pa LOS_MuxLock(&g_jffs2FsLock, (uint32_t)JFFS2_WAITING_FOREVER); - if (parentVnode->data == NULL) { - PRINT_ERR("%s-%d: rmdir parent of mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, parentVnode, parentVnode->useCount, parentVnode->data); - PRINT_ERR("%s-%d: global rmdir parent of mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, g_parentOfCoveredVnode, g_parentOfCoveredVnode->useCount, g_parentOfCoveredVnode->data); - } ret = jffs2_rmdir((struct jffs2_inode *)parentVnode->data, (struct jffs2_inode *)targetVnode->data, (const unsigned char *)path); diff --git a/fs/vfs/vnode.c b/fs/vfs/vnode.c index 8d6cc12082ae40120f0541622fb63d055160389f..af4971e0c14ab491ec42b397e0d1b046b341d177 100644 --- a/fs/vfs/vnode.c +++ b/fs/vfs/vnode.c @@ -44,9 +44,6 @@ static LosMux g_vnodeMux; static struct Vnode *g_rootVnode = NULL; static struct VnodeOps g_devfsOps; -extern int g_coveredVnodeTop; -extern struct Vnode *g_coveredVnodeList[100]; - #define ENTRY_TO_VNODE(ptr) LOS_DL_LIST_ENTRY(ptr, struct Vnode, actFreeEntry) #define VNODE_LRU_COUNT 10 #define DEV_VNODE_MODE 0755 @@ -93,8 +90,6 @@ static struct Vnode *GetFromFreeList(void) return vnode; } -extern struct Vnode *g_parentOfCoveredVnode; - struct Vnode *VnodeReclaimLru(void) { struct Vnode *item = NULL; @@ -165,7 +160,6 @@ int VnodeAlloc(struct VnodeOps *vop, struct Vnode **newVnode) VnodeDrop(); *newVnode = vnode; - PRINTK("%s-%d: vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data); return LOS_OK; } @@ -179,14 +173,6 @@ int VnodeFree(struct Vnode *vnode) struct PathCache *nextItem = NULL; VnodeHold(); - for (int i = 0; i < g_coveredVnodeTop; i++) { - if (vnode == g_coveredVnodeList[i]) { - PRINTK("%s-%d: reclaim mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data); - } - } - if (g_parentOfCoveredVnode == vnode) { - PRINTK("%s-%d: reclaim parent of mounted vnode. vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data); - } if (vnode->useCount > 0) { VnodeDrop(); return -EBUSY; @@ -205,7 +191,6 @@ int VnodeFree(struct Vnode *vnode) vnode->vop->Reclaim(vnode); } - PRINTK("%s-%d: vnode=%p userCount=%d inode=%p\n", __FUNCTION__, __LINE__, vnode, vnode->useCount, vnode->data); LOS_ListDelete(&vnode->actFreeEntry); memset_s(vnode, sizeof(struct Vnode), 0, sizeof(struct Vnode)); LOS_ListAdd(&g_vnodeFreeList, &vnode->actFreeEntry);