--- /dev/null
+--- uml-2.4.24/include/linux/fs.h.orig 2005-05-18 21:27:58.120742112 +0300
++++ uml-2.4.24/include/linux/fs.h 2005-05-18 22:48:12.081908776 +0300
+@@ -592,6 +592,7 @@
+ /* needed for tty driver, and maybe others */
+ void *private_data;
+ struct lookup_intent *f_it;
++ void *fs_private;
+ struct list_head f_ep_links;
+ spinlock_t f_ep_lock;
+ };
--- /dev/null
+--- uml-2.4.24/include/linux/fs.h.orig 2005-05-18 21:27:58.120742112 +0300
++++ uml-2.4.24/include/linux/fs.h 2005-05-18 22:48:12.081908776 +0300
+@@ -592,6 +592,7 @@
+ /* needed for tty driver, and maybe others */
+ void *private_data;
+ struct lookup_intent *f_it;
++ void *fs_private;
+
+ /* preallocated helper kiobuf to speedup O_DIRECT */
+ struct kiobuf *f_iobuf;
--- /dev/null
+--- linux-2.6.5-7.141/include/linux/fs.h.orig 2005-02-01 23:56:07.000000000 +0200
++++ linux-2.6.5-7.141/include/linux/fs.h 2005-05-18 23:23:15.486142728 +0300
+@@ -574,6 +574,7 @@
+ #endif /* #ifdef CONFIG_EPOLL */
+ struct address_space *f_mapping;
+ struct lookup_intent *f_it;
++ void *fs_private;
+ };
+ extern spinlock_t files_lock;
+ #define file_list_lock() spin_lock(&files_lock);
+Version 46: Separate ->fs_private in struct file
Version 45: more robust and general dev_read_only for failover (b=4834)
Version 44: fix link_path_walk_it() oops creating .foo in deleted "." (b=5548)
Version 43: fix remove_suid to not crash 2.6, and do anything on 2.4 (b=5695)
--- /dev/null Fri Aug 30 17:31:37 2002
+++ linux-2.4.18-18.8.0-l12-braam/include/linux/lustre_version.h Thu Feb 13 07:58:33 2003
@@ -0,0 +1 @@
-+#define LUSTRE_KERNEL_VERSION 45
++#define LUSTRE_KERNEL_VERSION 46
_
hostfs_readdir_large.patch
ext3-patch-fuzz-fixup-fc3.patch
uml-exprt-clearuser.patch
+fsprivate-2.6.patch
remove-suid-2.6-suse.patch
export-show_task-2.6-vanilla.patch
sd_iostats-2.6-rhel4.patch
+fsprivate-2.6.patch
link_notlast-susefix.patch
uml-exprt-clearuser.patch
qsnet-suse-2.6.patch
+fsprivate-2.6.patch
grab_cache_page_nowait_gfp-rh-2.4.patch
remove-suid-2.4-rhel.patch
qsnet-rhel-2.4.patch
+fsprivate-2.4.patch
loop-sync-2.4.21-suse.patch
ext3-extents-2.4.21-suse2.patch
ext3-extents-asyncdel-2.4.24.patch
+fsprivate-2.4-suse.patch
listman-2.4.20.patch
ext3-truncate-buffer-head.patch
lookup-stack-symbols-2.4.21-suse-171.patch
+fsprivate-2.4-suse.patch
uml-sigusr1-2.4-vanilla.patch
remove-suid-2.4-rhel.patch
uml-exprt-clearuser.patch
+fsprivate-2.4.patch
export-zap-page-range.patch
remove-suid-2.4-rhel.patch
kallsyms-2.4.29.patch
+fsprivate-2.4.patch
int ll_mdc_close(struct obd_export *mdc_exp, struct inode *inode,
struct file *file)
{
- struct ll_file_data *fd = file->private_data;
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
struct ptlrpc_request *req = NULL;
struct obd_client_handle *och = &fd->fd_mds_och;
struct obdo obdo;
mdc_clear_open_replay_data(och);
ptlrpc_req_finished(req);
och->och_fh.cookie = DEAD_HANDLE_MAGIC;
- file->private_data = NULL;
+ LUSTRE_FPRIVATE(file) = NULL;
OBD_SLAB_FREE(fd, ll_file_data_slab, sizeof *fd);
RETURN(rc);
RETURN(0);
lprocfs_counter_incr(sbi->ll_stats, LPROC_LL_RELEASE);
- fd = (struct ll_file_data *)file->private_data;
+ fd = LUSTRE_FPRIVATE(file);
LASSERT(fd != NULL);
if (lsm)
LASSERT (body != NULL); /* reply already checked out */
LASSERT_REPSWABBED (req, 1); /* and swabbed down */
- LASSERT(!file->private_data);
+ LASSERT(!LUSTRE_FPRIVATE(file));
OBD_SLAB_ALLOC(fd, ll_file_data_slab, SLAB_KERNEL, sizeof *fd);
/* We can't handle this well without reorganizing ll_file_open and
memcpy(&fd->fd_mds_och.och_fh, &body->handle, sizeof(body->handle));
fd->fd_mds_och.och_magic = OBD_CLIENT_HANDLE_MAGIC;
- file->private_data = fd;
+ LUSTRE_FPRIVATE(file) = fd;
ll_readahead_init(file->f_dentry->d_inode, &fd->fd_ras);
lli->lli_io_epoch = body->io_epoch;
}
node = ll_node_from_inode(inode, *ppos, *ppos + count - 1, LCK_PR);
- tree.lt_fd = filp->private_data;
+ tree.lt_fd = LUSTRE_FPRIVATE(filp);
rc = ll_tree_lock(&tree, node, buf, count,
filp->f_flags & O_NONBLOCK ? LDLM_FL_BLOCK_NOWAIT :0);
if (rc != 0)
if (IS_ERR(node))
RETURN(PTR_ERR(node));
- tree.lt_fd = file->private_data;
+ tree.lt_fd = LUSTRE_FPRIVATE(file);
rc = ll_tree_lock(&tree, node, buf, count,
file->f_flags & O_NONBLOCK ? LDLM_FL_BLOCK_NOWAIT :0);
if (rc != 0)
int ll_file_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
- struct ll_file_data *fd = file->private_data;
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
int flags;
ENTRY;
loff_t ll_file_seek(struct file *file, loff_t offset, int origin)
{
struct inode *inode = file->f_dentry->d_inode;
- struct ll_file_data *fd = file->private_data;
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(file);
struct lov_stripe_md *lsm = ll_i2info(inode)->lli_smd;
struct lustre_handle lockh = {0};
loff_t retval;
#define LLITE_INTERNAL_H
#include <linux/lustre_debug.h>
+#include <linux/lustre_version.h>
/*
struct lustre_intent_data {
#define LL_IT2STR(it) ((it) ? ldlm_it2str((it)->it_op) : "0")
+#if (LUSTRE_KERNEL_VERSION < 46)
+#define LUSTRE_FPRIVATE(file) ((file)->private_data)
+#else
+#define LUSTRE_FPRIVATE(file) ((file)->fs_private)
+#endif
+
+
static inline struct lookup_intent *ll_nd2it(struct nameidata *nd)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
#endif
{
struct file *filp = vma->vm_file;
- struct ll_file_data *fd = filp->private_data;
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(filp);
struct inode *inode = filp->f_dentry->d_inode;
struct lustre_handle lockh = { 0 };
ldlm_policy_data_t policy;
*/
int ll_readpage(struct file *filp, struct page *page)
{
- struct ll_file_data *fd = filp->private_data;
+ struct ll_file_data *fd = LUSTRE_FPRIVATE(filp);
struct inode *inode = page->mapping->host;
struct obd_export *exp;
struct ll_async_page *llap;
* kernel patch */
#include <linux/lustre_version.h>
#define LUSTRE_MIN_VERSION 32
-#define LUSTRE_MAX_VERSION 45
+#define LUSTRE_MAX_VERSION 46
#if (LUSTRE_KERNEL_VERSION < LUSTRE_MIN_VERSION)
# error Cannot continue: Your Lustre kernel patch is older than the sources
#elif (LUSTRE_KERNEL_VERSION > LUSTRE_MAX_VERSION)
}
run_test 54d "fifo device works in lustre ======================"
+test_54e() {
+ check_kernel_version 46 || return 0
+ f="$DIR/f54e"
+ string="aaaaaa"
+ mknod $f c 4 0
+ echo $string > $f || error
+}
+run_test 54e "console/tty device works in lustre ======================"
+
check_fstype() {
grep -q $FSTYPE /proc/filesystems && return 1
modprobe $FSTYPE