Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7017881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:58:18+00:00 2026-05-27T22:58:18+00:00

I want to get the filesystem mount point for a file system in my

  • 0

I want to get the filesystem mount point for a file system in my kernel module, which is a stackable filesystem.
Eg. if /home/ab/abc is a file and /home is mounted on a different filesystem I want to have a dentry or path struct to /home.
I want to do this in a module without modifying kernel code.
e.g. there is a file in /home/user/ and now I want to know in which partition this file is. For example this file might be in the partition same as “/” or this file might be in another partition mounted on /home or /home/user.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:58:19+00:00Added an answer on May 27, 2026 at 10:58 pm

    You can get the list of file systems from current->namespace. By iterating current->namespace->list (items being struct vfsmount) you can get all mounted file systems. vfsmount->mnt_mountpoint is the directory entry you want.

    You can follow the code that prints /proc/mounts (e.g. base.c/mountstats_open, namespace.c/m_start) to get more details (e.g. some locking is needed).

    I don’t know if you can do it in a kernel module, however.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given a mounted cifs file system /network/cifs which is case insensitive, how do I
I want to get the owner and group from a file using boost::filesystem, but
A want get all information which are in located in <forecast_conditions></forecast_conditions> tag for first
I want to programmatically change the volume icon for a stacked file system implemented
I want to write a Linux 2.6 netfilter module , which can check the
I have a Ruby app which (on Linux) uses the /proc filesystem to get
I have a filesystem like XML structure, and now I want to get the
I want get the return value class of an instance in runtime. The thing
i want get weather from http://www.google.com/ig/api?weather= I use this // load xml result from
I want get the user profile large or normal picture from facebook. Now I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.