Implement inotify interface and Indexing Service for Filesystem

Vishesh Yadav

Abstract

Implement Linux inotify interface in kernel. Based on inotify interface, build a daemon that operates as indexing service and works on locate database.

Additional Information

The goal of this project is to provide file system monitoring facilities in DragonFly BSD. This project is divided in to two parts -

  1. Implement inotify
  2. Implement a Filesystem indexing service for 'locate' over inotify.

inotify

DragonFly BSD provides kqueue/kevent interface to monitor file events which works very well. However it comes with overhead of having unique file descriptor for each watched file. Also, to watch changes in directories each file inside that directory has to opened and watched separately using kqueue/kevent. A system may reach the global/user file descriptor limit when watching a large number of file.

To solve this problem, I'll implement Linux's inotify interface. inotify interface can be used to monitor files and directories. Each inotify instance use one file descriptor.

Implementing inotify will benefit various applications that use inotify, eg. Gamin, GIO, KIO etc... It will benefit developers who want to implement file indexers, semantic desktop, malware scanners and end-users who are looking for application compatibility with Linux.

Filesystem indexing service

The second part of this project proposes to implement a Filesystem indexing service. The service will prepare database that will be used by locate utility. Unlike the traditional updatedb program, this will listen to filesystem changes and update the database instantly and therefore the database would be more accurate and up to date.

If time allows (or after GSoC), locate utility will be extended to store additional information about files such as size, owner, permissions etc.

Code samples