From: Andreas Dilger <adilger@turbolinux.com>
To: Christoph Rohland <cr@sap.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>,
linux-kernel@vger.kernel.org, Mathias.Froehlich@gmx.net
Subject: Re: [patch] make tmpfs_statfs more user friendly
Date: Mon, 5 Feb 2001 11:33:43 -0700 (MST) [thread overview]
Message-ID: <200102051833.f15IXhv21604@webber.adilger.net> (raw)
In-Reply-To: <m31ytemq7u.fsf@linux.local> from Christoph Rohland at "Feb 4, 2001 04:37:26 pm"
Christoph Rohland writes:
> The following patch make shmem_statfs report some sensible size
> estimates in the case that the user does not give a size limit.
>
> This should make it more error prone when used as /tmp
^^^^ less?
> diff -uNr 2.4.1-tmpfs/mm/shmem.c 2.4.1-tmpfs-fstat/mm/shmem.c
> --- 2.4.1-tmpfs/mm/shmem.c Sun Feb 4 16:08:57 2001
> +++ 2.4.1-tmpfs-fstat/mm/shmem.c Sun Feb 4 16:09:50 2001
> @@ -696,13 +696,20 @@
> buf->f_type = TMPFS_MAGIC;
> buf->f_bsize = PAGE_CACHE_SIZE;
> spin_lock (&sb->u.shmem_sb.stat_lock);
> - if (sb->u.shmem_sb.max_blocks != ULONG_MAX ||
> - sb->u.shmem_sb.max_inodes != ULONG_MAX) {
> + if (sb->u.shmem_sb.max_blocks == ULONG_MAX) {
> + /*
> + * This is only a guestimate and not honoured.
> + * We need it to make some programs happy which like to
> + * test the free space of a file system.
> + */
> + buf->f_bavail = buf->f_bfree = nr_free_pages() + nr_swap_pages + atomic_read(&buffermem_pages);
Should f_bavail be reduced by freepages.min or freepages.low?
> + buf->f_blocks = buf->f_bfree + ULONG_MAX - sb->u.shmem_sb.free_blocks;
It's not really clear what you are trying to calculate here... Since f_blocks
is a long, adding ULONG_MAX == subtracting 1. Maybe it should just hold
the total amount of VM in the system, (i.e. totalram_pages)?
Cheers, Andreas
--
Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto,
\ would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert
-
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/
next prev parent reply other threads:[~2001-02-05 18:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-02-04 15:37 Christoph Rohland
2001-02-05 7:05 ` Christoph Rohland
2001-02-05 18:33 ` Andreas Dilger [this message]
2001-02-05 20:14 ` Christoph Rohland
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=200102051833.f15IXhv21604@webber.adilger.net \
--to=adilger@turbolinux.com \
--cc=Mathias.Froehlich@gmx.net \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=cr@sap.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®