From mboxrd@z Thu Jan 1 00:00:00 1970 From: H Hartley Sweeten Subject: [PATCH] fs.h: introduce functions to get/set file->private_data Date: Mon, 16 Aug 2010 11:37:52 -0700 Message-ID: <201008161137.53187.hartleys@visionengravers.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: , To: Linux Kernel Return-path: Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org 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 Cc: Matthew Wilcox --- 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) {