linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
To: Evgeniy Polyakov <zbr-i6C2adt8DTjR7s880joybQ@public.gmane.org>
Cc: john-jueV0HHMeujJJrXXpGQQMAC/G2K4zDHf@public.gmane.org,
	arnd-r2nGTMty4D4@public.gmane.org,
	mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	hch-jcswGhMUV9g@public.gmane.org,
	rlove-L7G0xEPcOZbYtjvyW6yDsg@public.gmane.org,
	linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	pavel-AlSwsSmVLrQ@public.gmane.org,
	davidn-KzQzY1MbaKjAHznzqCTclw@public.gmane.org,
	Eric Paris <eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: [take2] Inotify: nested attributes support.
Date: Tue, 25 Nov 2008 16:24:34 -0800	[thread overview]
Message-ID: <20081125162434.4feacbbf.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081125194234.GA24449-i6C2adt8DTjR7s880joybQ@public.gmane.org>

On Tue, 25 Nov 2008 22:42:35 +0300
Evgeniy Polyakov <zbr-i6C2adt8DTjR7s880joybQ@public.gmane.org> wrote:

> Hi.
> 
> Attached patch (also attached test application) implementes
> scalable nested attributes which are transferred on behalf the inotify
> mechanism. It uses inotify_init1() to show that new event format should
> be returned when reading from inotify file descriptor.
> 
> Attributes are attached to given inotify instance via TIOCSETD ioctl,
> where ID of the attribute is transferred. If entry with given ID exists,
> it is removed and -EEXIST is returned.
> 
> There is a set of callbacks indexed by ID (currently 4 attributes are
> supported: pid, tid, io details (start/size of the written block) and
> name), which are attached to given inotify device.
> When new event is created, each callback is executed and may queue some
> data into event structure, based on its internal details. When event is
> read from the userspace, first its header is transferred (old
> inotify_event structure) and then all attributes data in the order of
> its registration via above ioctl. Nested attributes have following
> structure: 
> 
> struct inotify_attribute
> {
> 	unsigned int		id;
> 	unsigned int		size;
> 	unsigned char		data[0];
> };
> 
> where size is nuber of attached bytes for given attribute.
> inotify_event.len contains number of bytes used to store all attached
> attributes and data.
> 
> Attribute callback can check if mask contains its bits and do some steps
> based on that information, for example io details attribute does not add
> own data (and header) if event mask does not contain IN_MODIFY bit.
> 
> It is possible to infinitely extend number of attributes processed, so
> we will be no longer limited by inotify API and ABI.
> 
> Test application usage:
> $ gcc ./iotest.c -W -Wall -I/path/to/kernel/include/ -o iotest
> $ ./iotest -f /tmp/ -t -n -p -i
> 2008-11-25 22:29:47.8477 pid: 1850, tid: 1850, name: /tmp/, wd: 1, mask: 303, attributes: pid: 1, tid: 1, io: 1, name: 1.
> event: 2, wd: 1, cookie: 0, len: 61.
> 	tid: 1672.
> 	pid: 1672.
> 	io details: start: 0, size: 0.
> 	name: test.
> event: 2, wd: 1, cookie: 0, len: 61.
> 	tid: 1672.
> 	pid: 1672.
> 	io details: start: 0, size: 6.
> 	name: test.
> 
> Example with only tid and io details:
> $ $ ./iotest -f /tmp/ -t -i
> 2008-11-25 22:40:30.201286 pid: 1928, tid: 1928, name: /tmp/, wd: 1,
> mask: 303, attributes: pid: 0, tid: 1, io: 1, name: 0.
> event: 2, wd: 1, cookie: 0, len: 36.
> 	tid: 1672.
> 	io details: start: 0, size: 0.
> 
> 
> while in parallel I did:
> $ echo qwe11 > /tmp/test
> 
> Two events were sent because of two calls for fsnotify_modify(), invoked
> lkely from attribute change and write. Events are not combined since
> because attributes may be different. Not having a name always combines
> (read: skips next event) events because of old logic.
> 

I guess I'm being more than usually thick, but I don't understand what
this is all about, why it was implemented, what value it provides to
users, etc, etc?  Why do I want scalable nested attributes in inotify??

I'm buried in patches which I don't understand lately, and having
hundreds of people send patches at one guy who doesn't understand them
isn't a good system.  Eric Paris is working on inotify-type things as
well.  It would be neat if you guys were to understand and review each
other's work.  Please.

--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2008-11-26  0:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-25 19:42 [take2] Inotify: nested attributes support Evgeniy Polyakov
     [not found] ` <20081125194234.GA24449-i6C2adt8DTjR7s880joybQ@public.gmane.org>
2008-11-25 19:44   ` [take2] Inotify: nested attributes test application Evgeniy Polyakov
2008-11-26  0:24   ` Andrew Morton [this message]
     [not found]     ` <20081125162434.4feacbbf.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-11-26  7:42       ` [take2] Inotify: nested attributes support Evgeniy Polyakov
     [not found]         ` <20081126074239.GA17525-i6C2adt8DTjR7s880joybQ@public.gmane.org>
2008-11-26  8:15           ` Andrew Morton
     [not found]             ` <20081126001538.4b1c7c99.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-11-26  8:29               ` Evgeniy Polyakov
     [not found]                 ` <20081126082936.GB17525-i6C2adt8DTjR7s880joybQ@public.gmane.org>
2008-11-26  8:38                   ` Andrew Morton
     [not found]                     ` <20081126003825.2b9a92be.akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
2008-11-26  8:46                       ` Evgeniy Polyakov
2008-11-26 12:47                   ` David Newall
     [not found]                     ` <492D4560.8000302-KzQzY1MbaKjAHznzqCTclw@public.gmane.org>
2008-11-26 12:51                       ` Evgeniy Polyakov
     [not found]                         ` <20081126125113.GA8921-i6C2adt8DTjR7s880joybQ@public.gmane.org>
2008-11-26 13:03                           ` David Newall
     [not found]                             ` <492D4927.8040204-KzQzY1MbaKjAHznzqCTclw@public.gmane.org>
2008-11-26 13:15                               ` Evgeniy Polyakov
2008-12-04  8:43                 ` Pavel Machek
     [not found]                   ` <20081204084309.GA2072-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2008-12-04  9:09                     ` Evgeniy Polyakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081125162434.4feacbbf.akpm@linux-foundation.org \
    --to=akpm-de/tnxtf+jlsfhdxvbkv3wd2fqjk+8+b@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=davidn-KzQzY1MbaKjAHznzqCTclw@public.gmane.org \
    --cc=eparis-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=hch-jcswGhMUV9g@public.gmane.org \
    --cc=john-jueV0HHMeujJJrXXpGQQMAC/G2K4zDHf@public.gmane.org \
    --cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pavel-AlSwsSmVLrQ@public.gmane.org \
    --cc=rlove-L7G0xEPcOZbYtjvyW6yDsg@public.gmane.org \
    --cc=zbr-i6C2adt8DTjR7s880joybQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).