make get_file() return its argument
[pandora-kernel.git] / include / linux / fs.h
index dd74385..b2ccd1e 100644 (file)
@@ -486,6 +486,12 @@ struct iattr {
  */
 #include <linux/quota.h>
 
+/*
+ * Maximum number of layers of fs stack.  Needs to be limited to
+ * prevent kernel stack overflow
+ */
+#define FILESYSTEM_MAX_STACK_DEPTH 2
+
 /** 
  * enum positive_aop_returns - aop return codes with specific semantics
  *
@@ -1026,7 +1032,11 @@ struct file_handle {
        unsigned char f_handle[0];
 };
 
-#define get_file(x)    atomic_long_inc(&(x)->f_count)
+static inline struct file *get_file(struct file *f)
+{
+       atomic_long_inc(&f->f_count);
+       return f;
+}
 #define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
 #define file_count(x)  atomic_long_read(&(x)->f_count)
 
@@ -1497,6 +1507,11 @@ struct super_block {
        int cleancache_poolid;
 
        struct shrinker s_shrink;       /* per-sb shrinker handle */
+
+       /*
+        * Indicates how deep in a filesystem stack this SB is
+        */
+       int s_stack_depth;
 };
 
 /* superblock cache pruning functions */
@@ -2073,7 +2088,7 @@ extern long do_sys_open(int dfd, const char __user *filename, int flags,
                        int mode);
 extern struct file *filp_open(const char *, int, int);
 extern struct file *file_open_root(struct dentry *, struct vfsmount *,
-                                  const char *, int);
+                                  const char *, int, umode_t);
 extern struct file * dentry_open(struct dentry *, struct vfsmount *, int,
                                 const struct cred *);
 extern int filp_close(struct file *, fl_owner_t id);
@@ -2604,7 +2619,7 @@ extern int buffer_migrate_page(struct address_space *,
 #define buffer_migrate_page NULL
 #endif
 
-extern int inode_change_ok(const struct inode *, struct iattr *);
+extern int setattr_prepare(struct dentry *, struct iattr *);
 extern int inode_newsize_ok(const struct inode *, loff_t offset);
 extern void setattr_copy(struct inode *inode, const struct iattr *attr);