aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern Brandenburg <bbb@mpi-sws.org>2013-06-23 09:26:01 -0400
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-08-07 03:46:40 -0400
commit01a0a30a003019092e7748049a03bb5cfd0ab918 (patch)
treedb5d00c3dab49a75a3ac78665e560cc6524699ec
parent77c2b05c943abc0dfdb7b55a3d1d4a1a3fc53dcd (diff)
Add object list to inodes
This patch adds a list of arbitrary objects to inodes. This is used by Linux's locking API to attach lock objects to inodes (which represent namespaces in Linux's locking API).
-rw-r--r--fs/inode.c2
-rw-r--r--include/linux/fs.h5
2 files changed, 7 insertions, 0 deletions
diff --git a/fs/inode.c b/fs/inode.c
index 00d5fc3b86e1..a80e3263f8f2 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -370,6 +370,8 @@ void inode_init_once(struct inode *inode)
370#ifdef CONFIG_FSNOTIFY 370#ifdef CONFIG_FSNOTIFY
371 INIT_HLIST_HEAD(&inode->i_fsnotify_marks); 371 INIT_HLIST_HEAD(&inode->i_fsnotify_marks);
372#endif 372#endif
373 INIT_LIST_HEAD(&inode->i_obj_list);
374 mutex_init(&inode->i_obj_mutex);
373} 375}
374EXPORT_SYMBOL(inode_init_once); 376EXPORT_SYMBOL(inode_init_once);
375 377
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 65c2be22b601..8a0ac17dc350 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -508,6 +508,7 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
508 508
509struct posix_acl; 509struct posix_acl;
510#define ACL_NOT_CACHED ((void *)(-1)) 510#define ACL_NOT_CACHED ((void *)(-1))
511struct inode_obj_id_table;
511 512
512#define IOP_FASTPERM 0x0001 513#define IOP_FASTPERM 0x0001
513#define IOP_LOOKUP 0x0002 514#define IOP_LOOKUP 0x0002
@@ -606,6 +607,10 @@ struct inode {
606#ifdef CONFIG_IMA 607#ifdef CONFIG_IMA
607 atomic_t i_readcount; /* struct files open RO */ 608 atomic_t i_readcount; /* struct files open RO */
608#endif 609#endif
610
611 struct list_head i_obj_list;
612 struct mutex i_obj_mutex;
613
609 void *i_private; /* fs or device private pointer */ 614 void *i_private; /* fs or device private pointer */
610}; 615};
611 616