[Yaffs] delete inode on 2.6.14

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Michael Trimarchi
Date:  
To: yaffs
Subject: [Yaffs] delete inode on 2.6.14
Hi all,
I think the yaffs_delete_inode on yaffs must be correct on new kernel.

static void yaffs_delete_inode(struct inode *inode)
{
    yaffs_Object *obj = yaffs_InodeToObject(inode);
    yaffs_Device *dev;


    T(YAFFS_TRACE_OS,("yaffs_delete_inode: ino %d, count %d 
%s\n",(int)inode->i_ino, atomic_read(&inode->i_count),
        obj ? "object exists" : "null object"));


    if(obj)
    {
         dev = obj->myDev;
        yaffs_GrossLock(dev);
        yaffs_DeleteFile(obj);
        yaffs_GrossUnlock(dev);
    }
    clear_inode(inode);


}

The new one:

static void yaffs_delete_inode(struct inode *inode)
{
        yaffs_Object *obj = yaffs_InodeToObject(inode);
        yaffs_Device *dev;


        if (inode->i_data.nrpages)
                truncate_inode_pages(&inode->i_data, 0);


        T(YAFFS_TRACE_OS,("yaffs_delete_inode: ino %d, count %d 
%s\n",(int)inode->i_ino, atomic_read(&inode->i_count),
                obj ? "object exists" : "null object"));


        if(obj)
        {
                dev = obj->myDev;
                yaffs_GrossLock(dev);
                yaffs_DeleteFile(obj);
                yaffs_GrossUnlock(dev);
        }
        clear_inode(inode);
}



Is it correct?

Regards Michael