Skip to contentSkip to conversation

FS callback routines

DISCUSSION Sean R. Bright 3 participants 3 messages Jan 9, 2001

lore
Share & tools
lore
#0 lore raw

Ok, before I begin, don't shoot me down, but I had an idea for a kernel
modification and was wondering how feasible the group thought it was.

I was writing a user space application to monitor a folder's contents. The
folder itself contained 100 folders, and each of those contained 24 folders. While writing the code to traverse the directory structure I realized that instead of my software figuring out when things change, why not just have the fs tell my application when something was updated. For example, say we had a function called watch_fs(), that took an inode reference and a function pointer and maybe a bitmask of events to watch for. When that inode (or its children) were changed, why couldn't the fs code call the callback function I specified?

I have no idea how expensive this would be or if its even worth it at this
point. It also wouldn't be portable at all considering that I know of no other OS that does this (could be wrong).

Like I said, I am not asking that this be (necessarily) implemented, I am
just curious as to what the percieved performance ramifications would be if it were to implemented, say, by a virgin kernel developer ;)

Thanks,
Sean
[email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/

#1 lore raw
Quoted 13 lines · Sean R. Bright

Ok, before I begin, don't shoot me down, but I had an idea for a kernel
modification and was wondering how feasible the group thought it was.

I was writing a user space application to monitor a folder's contents. The
folder itself contained 100 folders, and each of those contained 24 folders. While writing the code to traverse the directory structure I realized that instead of my software figuring out when things change, why not just have the fs tell my application when something was updated. For example, say we had a function called watch_fs(), that took an inode reference and a function pointer and maybe a bitmask of events to watch for. When that inode (or its children) were changed, why couldn't the fs code call the callback function I specified?

Quoted 7 lines

I have no idea how expensive this would be or if its even worth it at this
point. It also wouldn't be portable at all considering that I know of no other OS that does this (could be wrong).

Like I said, I am not asking that this be (necessarily) implemented, I am
just curious as to what the percieved performance ramifications would be if it were to implemented, say, by a virgin kernel developer ;)

you want to have a look at

http://oss.sgi.com/projects/fam/

resp. imon, the corresponding kernel modules.

this has been around for quite some time now. enlightenment has been/still is? using it since it's earliest incarnations of its file manager extension efm. (same with kde? not sure..)

i'm wondering whether this could get into the mainstream kernels soon? i'm not really deep in the filesystem layers, but this sounds to me like an extremely useful feature.

could anyone comment on section 2 of
http://oss.sgi.com/projects/fam/imon.txt ? would this actually be the way to do it or is there any better method?

regards,
dns

Signature · 6 lines
___________________________________________________________________________
 mailto:[email protected]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/
#2 lore raw
In reply to Sean R. Bright
Quoted 9 lines · Sean R. Bright

I was writing a user space application to monitor a folder's contents. The folder itself contained 100 folders, and each of those contained 24 folders. While writing the code to traverse the directory structure I realized that instead of my software figuring out when things change, why not just have the fs tell my application when something was updated. For example, say we had a function called watch_fs(), that took an inode reference and a function pointer and maybe a bitmask of events to watch for. When that inode (or its children) were changed, why couldn't the fs code call the callback function I specified?

RFTM: linux-2.4.0/Documentation/dnotify.txt

BYtE
Philipp

Signature · 8 lines
  / /  (_)__  __ ____  __ Philipp Hahn
 / /__/ / _ \/ // /\ \/ /
/____/_/_//_/\_,_/ /_/\_\ [email protected]

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
Please read the FAQ at http://www.tux.org/lkml/