All of lore.kernel.org
 help / color / mirror / Atom feed
From: Erik Andersen <andersen@codepoet.org>
To: Pozsar Balazs <pozsy@sch.bme.hu>
Cc: linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: _reliable_ way to get the dev for a mount point?
Date: Mon, 6 May 2002 11:38:57 -0600	[thread overview]
Message-ID: <20020506173857.GA24013@codepoet.org> (raw)
In-Reply-To: <Pine.GSO.4.30.0205051830060.28842-100000@balu>

On Mon May 06, 2002 at 11:55:38AM +0200, Pozsar Balazs wrote:
> So, my question is there a way to get back the device for a directory,
> _reliably_. (I want to know which devices holds the files my process sees
> under an arbitrary /path/to/somewhere).

stat(mnt_point, &statbuf); then walk through /dev and stat each
device, check that it is a block device and that st_rdev matches
the statbuf.st_rdev.  When you get a match, you know a device
name for the directory.

 -Erik

--
Erik B. Andersen             http://codepoet-consulting.com/
--This message was written using 73% post-consumer electrons--

  reply	other threads:[~2002-05-06 17:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-06  9:55 _reliable_ way to get the dev for a mount point? Pozsar Balazs
2002-05-06 17:38 ` Erik Andersen [this message]
2002-05-06 18:10   ` Xavier Bestel
2002-05-08 10:28     ` Denis Vlasenko

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=20020506173857.GA24013@codepoet.org \
    --to=andersen@codepoet.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pozsy@sch.bme.hu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.