aboutsummaryrefslogtreecommitdiffstats
path: root/fs/udf/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/udf/super.c')
-rw-r--r--fs/udf/super.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/fs/udf/super.c b/fs/udf/super.c
index f99ff5dbd741..948e1aca0f34 100644
--- a/fs/udf/super.c
+++ b/fs/udf/super.c
@@ -1823,6 +1823,33 @@ static void udf_close_lvid(struct super_block *sb)
1823 sbi->s_lvid_dirty = 0; 1823 sbi->s_lvid_dirty = 0;
1824} 1824}
1825 1825
1826u64 lvid_get_unique_id(struct super_block *sb)
1827{
1828 struct buffer_head *bh;
1829 struct udf_sb_info *sbi = UDF_SB(sb);
1830 struct logicalVolIntegrityDesc *lvid;
1831 struct logicalVolHeaderDesc *lvhd;
1832 u64 uniqueID;
1833 u64 ret;
1834
1835 bh = sbi->s_lvid_bh;
1836 if (!bh)
1837 return 0;
1838
1839 lvid = (struct logicalVolIntegrityDesc *)bh->b_data;
1840 lvhd = (struct logicalVolHeaderDesc *)lvid->logicalVolContentsUse;
1841
1842 mutex_lock(&sbi->s_alloc_mutex);
1843 ret = uniqueID = le64_to_cpu(lvhd->uniqueID);
1844 if (!(++uniqueID & 0xFFFFFFFF))
1845 uniqueID += 16;
1846 lvhd->uniqueID = cpu_to_le64(uniqueID);
1847 mutex_unlock(&sbi->s_alloc_mutex);
1848 mark_buffer_dirty(bh);
1849
1850 return ret;
1851}
1852
1826static void udf_sb_free_bitmap(struct udf_bitmap *bitmap) 1853static void udf_sb_free_bitmap(struct udf_bitmap *bitmap)
1827{ 1854{
1828 int i; 1855 int i;