Compare changes in mount tables

Compare changes in mount tables — compare changes in the list of the mounted filesystems

Functions

Types and Values

Description

Functions

mnt_new_tabdiff ()

struct libmnt_tabdiff *
mnt_new_tabdiff (void);

Allocates a new table diff struct.

Returns

new diff handler or NULL.


mnt_free_tabdiff ()

void
mnt_free_tabdiff (struct libmnt_tabdiff *df);

Deallocates tab diff struct and all entries.

Parameters

df

tab diff

 

mnt_tabdiff_next_change ()

int
mnt_tabdiff_next_change (struct libmnt_tabdiff *df,
                         struct libmnt_iter *itr,
                         struct libmnt_fs **old_fs,
                         struct libmnt_fs **new_fs,
                         int *oper);

The options old_fs , new_fs and oper are optional.

Parameters

df

tabdiff pointer

 

itr

iterator

 

old_fs

returns the old entry or NULL if new entry added

 

new_fs

returns the new entry or NULL if old entry removed

 

oper

MNT_TABDIFF_{MOVE,UMOUNT,REMOUNT,MOUNT} flags

 

Returns

0 on success, negative number in case of error or 1 at the end of list.


mnt_diff_tables ()

int
mnt_diff_tables (struct libmnt_tabdiff *df,
                 struct libmnt_table *old_tab,
                 struct libmnt_table *new_tab);

Compares old_tab and new_tab , the result is stored in df and accessible by mnt_tabdiff_next_change().

Parameters

df

diff handler

 

old_tab

old table

 

new_tab

new table

 

Returns

number of changes, negative number in case of error.

Types and Values

struct libmnt_tabdiff

struct libmnt_tabdiff;

Stores mountinfo state