Whamcloud - gitweb
LU-12275 sec: encryption for write path
[fs/lustre-release.git] / lustre / include / obd.h
index 4e585ad..f758aae 100644 (file)
@@ -119,6 +119,11 @@ struct brw_page {
        struct page     *pg;
        u32              count;
        u32              flag;
+       /* used for encryption: difference with offset in clear text page */
+       u16              bp_off_diff;
+       /* used for encryption: difference with count in clear text page */
+       u16              bp_count_diff;
+       u32              bp_padding;
 };
 
 struct timeout_item {
@@ -1302,4 +1307,16 @@ static inline void client_adjust_max_dirty(struct client_obd *cli)
                                           1 << (20 - PAGE_SHIFT));
 }
 
+static inline struct inode *page2inode(struct page *page)
+{
+       if (page->mapping) {
+               if (PageAnon(page))
+                       return NULL;
+               else
+                       return page->mapping->host;
+       } else {
+               return NULL;
+       }
+}
+
 #endif /* __OBD_H */