* [Question] inotify : process based filtering of events
@ 2008-12-20 6:51 Niraj kumar
2008-12-20 10:40 ` Evgeniy Polyakov
0 siblings, 1 reply; 4+ messages in thread
From: Niraj kumar @ 2008-12-20 6:51 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel
All,
I am trying to use inotify to monitor filesystem events but
my problem is that I am only interested in changes that
is being done by a particular process and it's children
(could be the same process which used inotify APIs).
Is it possible to achieve this process based filtering of events
using inotify infrastructure?
-Niraj
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Question] inotify : process based filtering of events
2008-12-20 6:51 [Question] inotify : process based filtering of events Niraj kumar
@ 2008-12-20 10:40 ` Evgeniy Polyakov
2008-12-20 13:13 ` Niraj kumar
0 siblings, 1 reply; 4+ messages in thread
From: Evgeniy Polyakov @ 2008-12-20 10:40 UTC (permalink / raw)
To: Niraj kumar; +Cc: linux-kernel, linux-fsdevel
Hi.
On Sat, Dec 20, 2008 at 12:21:33PM +0530, Niraj kumar (niraj17@gmail.com) wrote:
> I am trying to use inotify to monitor filesystem events but
> my problem is that I am only interested in changes that
> is being done by a particular process and it's children
> (could be the same process which used inotify APIs).
>
> Is it possible to achieve this process based filtering of events
> using inotify infrastructure?
You can try using inotify nested attributes patch [1] and filter events
in userspace based on reported pid/tid. With the fsnotify changes coming
it may be possible to have similar functionality there.
1. Inotify nested attributes.
http://lkml.org/lkml/2008/11/25/272
2. Example usage and test application.
http://www.ioremap.net/node/73
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Question] inotify : process based filtering of events
2008-12-20 10:40 ` Evgeniy Polyakov
@ 2008-12-20 13:13 ` Niraj kumar
2008-12-20 17:13 ` Evgeniy Polyakov
0 siblings, 1 reply; 4+ messages in thread
From: Niraj kumar @ 2008-12-20 13:13 UTC (permalink / raw)
To: Evgeniy Polyakov; +Cc: linux-kernel, linux-fsdevel
>>
>> Is it possible to achieve this process based filtering of events
>> using inotify infrastructure?
>
> You can try using inotify nested attributes patch [1] and filter events
> in userspace based on reported pid/tid.
I saw your patch and the related discussion...
But I am thinking that filtering in userspace based on pid/tid
could be too much overhead when the data that I am interested
in might be just a small fraction of the whole thing...
I was hoping to add a flag (similar to IN_ATTRS that you have added)
which, when used, will only collect events for the calling
process and it's children...
-Niraj
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Question] inotify : process based filtering of events
2008-12-20 13:13 ` Niraj kumar
@ 2008-12-20 17:13 ` Evgeniy Polyakov
0 siblings, 0 replies; 4+ messages in thread
From: Evgeniy Polyakov @ 2008-12-20 17:13 UTC (permalink / raw)
To: Niraj kumar; +Cc: linux-kernel, linux-fsdevel
On Sat, Dec 20, 2008 at 06:43:01PM +0530, Niraj kumar (niraj17@gmail.com) wrote:
> I was hoping to add a flag (similar to IN_ATTRS that you have added)
> which, when used, will only collect events for the calling
> process and it's children...
With nested attributes patch you can add your own callback which will
check private list of interested pids and only add event into the queue
when current credentials match stored data. IMHO that will br much
smaller amount of work than extending inotify with new flag and redoing
new event structure processing. But it is up to you to decide of course
:)
--
Evgeniy Polyakov
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-12-20 17:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-20 6:51 [Question] inotify : process based filtering of events Niraj kumar
2008-12-20 10:40 ` Evgeniy Polyakov
2008-12-20 13:13 ` Niraj kumar
2008-12-20 17:13 ` Evgeniy Polyakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).