[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Dazuko-help] Event mask
From: |
John Ogness |
Subject: |
Re: [Dazuko-help] Event mask |
Date: |
Tue, 22 Jun 2010 21:03:19 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) |
On 2010-06-22, Сергей Петров <address@hidden> wrote:
> I do the small file monitor for anti-virus check of files. In my
> case it is convenient to fulfil check after file closing. In this
> case the file is completely written, and it is possible to start
> scanning process. But in a dazukofs 3.x there is no mask of
> events. I cannot watch event "ON_CLOSE". How it is possible to solve
> this problem?
With DazukoFS there is only support for ON_OPEN events. It would be
fairly easy to catch ON_CLOSE events if you wanted to hack it in
DazukoFS.
I haven't tried it, but it probably is sufficient to add:
dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
to file.c:dazukofs_release() so that it looks like this:
static int dazukofs_release(struct inode *inode, struct file *file)
{
struct inode *lower_inode = get_lower_inode(inode);
dazukofs_check_access(file->f_dentry, file->f_vfsmnt);
fput(get_lower_file(file));
inode->i_blocks = lower_inode->i_blocks;
kmem_cache_free(dazukofs_file_info_cachep, get_file_private(file));
return 0;
}
Of course, it makes no sense to _block_ close events. But the above
change should allow your DazukoFS clients to be notified about it.
John Ogness
--
Dazuko Maintainer