linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs.h: introduce functions to get/set file->private_data
@ 2010-08-16 18:37 H Hartley Sweeten
  2010-08-16 23:17 ` Christoph Hellwig
  0 siblings, 1 reply; 13+ messages in thread
From: H Hartley Sweeten @ 2010-08-16 18:37 UTC (permalink / raw)
  To: Linux Kernel; +Cc: linux-fsdevel, matthew

The symbol 'private_data' is commonly used and makes grep'ing for
specific uses difficult. Introduce the wrapper functions file_get_privdata
and file_set_privdata to help with the struct file uses.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Matthew Wilcox <matthew@wil.cx>

---

diff --git a/include/linux/fs.h b/include/linux/fs.h
index 9a96b4d..b357a17 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -961,6 +961,16 @@ extern spinlock_t files_lock;
 #define fput_atomic(x)	atomic_long_add_unless(&(x)->f_count, -1, 1)
 #define file_count(x)	atomic_long_read(&(x)->f_count)
 
+static inline void *file_get_privdata(struct file *file)
+{
+	return file->private_data;
+}
+
+static inline void file_set_privdata(struct file *file, void *data)
+{
+	file->private_data = data;
+}
+
 #ifdef CONFIG_DEBUG_WRITECOUNT
 static inline void file_take_write(struct file *f)
 {

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2010-08-18 17:15 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-16 18:37 [PATCH] fs.h: introduce functions to get/set file->private_data H Hartley Sweeten
2010-08-16 23:17 ` Christoph Hellwig
2010-08-16 23:36   ` H Hartley Sweeten
2010-08-16 23:50     ` Joe Perches
2010-08-17  1:03       ` Ted Ts'o
2010-08-17  1:58         ` Joe Perches
2010-08-17  8:54         ` Christoph Hellwig
     [not found]         ` <20100817085428.GA25330@infradead.org>
2010-08-17 17:26           ` Joe Perches
2010-08-17 17:58             ` Sam Ravnborg
2010-08-17 18:21               ` Joe Perches
2010-08-18  1:32               ` Joe Perches
2010-08-18 16:48                 ` H Hartley Sweeten
2010-08-18 17:15                   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).