mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-24 12:07:54 +00:00
btrfs-progs: delete unused function get_mountpt
and get_btrfs_mount has replaced it Signed-off-by: Anand Jain <anand.jain@oracle.com>
This commit is contained in:
parent
f592cd1cc0
commit
486e7ca4cd
35
utils.c
35
utils.c
@ -974,41 +974,6 @@ out_mntloop_err:
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gets the mount point of btrfs filesystem that is using the specified device.
|
|
||||||
* Returns 0 is everything is good, <0 if we have an error.
|
|
||||||
* TODO: Fix this fucntion and check_mounted to work with multiple drive BTRFS
|
|
||||||
* setups.
|
|
||||||
*/
|
|
||||||
int get_mountpt(char *dev, char *mntpt, size_t size)
|
|
||||||
{
|
|
||||||
struct mntent *mnt;
|
|
||||||
FILE *f;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
f = setmntent("/proc/mounts", "r");
|
|
||||||
if (f == NULL)
|
|
||||||
return -errno;
|
|
||||||
|
|
||||||
while ((mnt = getmntent(f)) != NULL )
|
|
||||||
{
|
|
||||||
if (strcmp(dev, mnt->mnt_fsname) == 0)
|
|
||||||
{
|
|
||||||
strncpy(mntpt, mnt->mnt_dir, size);
|
|
||||||
if (size)
|
|
||||||
mntpt[size-1] = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mnt == NULL)
|
|
||||||
{
|
|
||||||
/* We didn't find an entry so lets report an error */
|
|
||||||
ret = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct pending_dir {
|
struct pending_dir {
|
||||||
struct list_head list;
|
struct list_head list;
|
||||||
char name[PATH_MAX];
|
char name[PATH_MAX];
|
||||||
|
Loading…
Reference in New Issue
Block a user