From: H Hartley Sweeten <hartleys@visionengravers.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: <linux-fsdevel@vger.kernel.org>, <matthew@wil.cx>
Subject: [PATCH] fs.h: introduce functions to get/set file->private_data
Date: Mon, 16 Aug 2010 11:37:52 -0700 [thread overview]
Message-ID: <201008161137.53187.hartleys@visionengravers.com> (raw)
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)
{
next reply other threads:[~2010-08-16 18:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-16 18:37 H Hartley Sweeten [this message]
2010-08-16 23:17 ` [PATCH] fs.h: introduce functions to get/set file->private_data 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
2010-08-17 8:54 ` Christoph Hellwig
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 16:48 ` H Hartley Sweeten
2010-08-18 17:15 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201008161137.53187.hartleys@visionengravers.com \
--to=hartleys@visionengravers.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=matthew@wil.cx \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.