Re: NFS caching.

Miquel van Smoorenburg (miquels@cistron.nl)
31 Oct 1999 13:43:19 +0100


In article <cistron.199910311130.MAA02204@cave.bitwizard.nl>,
Rogier Wolff <R.E.Wolff@BitWizard.nl> wrote:
>2.2.x caches NFS accesses. I have a LED on the wall that indicates
>that I have mail.

Cool ;)

>When I see it on, I want to read my Email. Is there
>a way that I can foce a cache invalidate? It is now annoying to have
>to wait something like 30 seconds before I can read Email that I know
>is simply sitting in my mailbox...

fd = open("/var/spool/mail/rogier", O_RDONLY);
if (lockf(fd, F_TLOCK, 0) == 0)
lockf(fd, F_ULOCK, 0);
fstat(fd, &st);
.....

Setting or trying to set a POSIX lock on a filedescriptor invalidates the
NFS cache - all programs dealing with mail should use this

Mike.

-- 
First things first, but not necessarily in that order.

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