lkml.org 
[lkml]   [2000]   [Aug]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] thread wakeup fix for 2.4.0-test7
Date
Hello!

> normal UNIX semantics. close(dup(fd)) should have _no_ effect.

Grrr... No doubts!

File is closed, when all the references from user disappear.

I have already tried to clean this issue times in the past.



File must have two refcounts: f_users and f_count.
f_users counts references from user i.e. from file descriptor
tables (and from a few of descriptor-less files inside kernel).

fget() and fput() work on f_count.

When f_users becomes zero, file is closed, but not destroyed.
Method fops->flush() is called to shutdown it. It wakes up
processes holding f_count on this file, particualry.

When f_count becomes zero, it is destroyed. Method fos->close()
is called before destruction.

Alexey
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.088 / U:2.976 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site