|
@@ -28,6 +28,7 @@
|
|
|
#include "segment.h"
|
|
|
#include "page.h"
|
|
|
#include "mdt.h"
|
|
|
+#include "alloc.h" /* nilfs_palloc_destroy_cache() */
|
|
|
|
|
|
#include <trace/events/nilfs2.h>
|
|
|
|
|
@@ -465,6 +466,30 @@ int nilfs_mdt_init(struct inode *inode, gfp_t gfp_mask, size_t objsz)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * nilfs_mdt_clear - do cleanup for the metadata file
|
|
|
+ * @inode: inode of the metadata file
|
|
|
+ */
|
|
|
+void nilfs_mdt_clear(struct inode *inode)
|
|
|
+{
|
|
|
+ struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
|
|
|
+
|
|
|
+ if (mdi->mi_palloc_cache)
|
|
|
+ nilfs_palloc_destroy_cache(inode);
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * nilfs_mdt_destroy - release resources used by the metadata file
|
|
|
+ * @inode: inode of the metadata file
|
|
|
+ */
|
|
|
+void nilfs_mdt_destroy(struct inode *inode)
|
|
|
+{
|
|
|
+ struct nilfs_mdt_info *mdi = NILFS_MDT(inode);
|
|
|
+
|
|
|
+ kfree(mdi->mi_bgl); /* kfree(NULL) is safe */
|
|
|
+ kfree(mdi);
|
|
|
+}
|
|
|
+
|
|
|
void nilfs_mdt_set_entry_size(struct inode *inode, unsigned entry_size,
|
|
|
unsigned header_size)
|
|
|
{
|